整理:mouri

0==========
原文(wakeful于2001/06/16 12:45粘贴) 
★理解软件体系结构--我的笔记一篇 
--------------------------------------------------------------------------------
知道这里高手多,请指教。 


软件体系结构为什么: 
1. 突破程序员(coder),成为设计师(architect),必须精通它。 
2. 软件开发最大的风险来自需求变更,但一蹴而就搞定需求不现实,而且客户×××,好的architecture是易改动的基础。 
3. reuse很重要,design reuse比code reuse更有用更难,MFC 的framework就是很好的design reuse,相信大家都体会到了其妙处。 


题目:理解软件体系结构 

类型:笔记 

整理:温昱 

感谢:《software architecture》一书的作者Mary Shaw和David Garlan,以及出版该书影印版的清华大学出版社 

----------------------------------非定义---------------------------- 

intermediate abstractions 

gap-filling abstractions 

structure and topology 

system organization 

design pattern 

framework 

skeleton 

----------------------------------定义---------------------------- 

The architecture of a software system defines that system in terms of computational COMPONENTS and INTERACTIONS among those components. 

----------------------------------定义理解---------------------------- 

COMPONENTS=client+server+filter+layer+database 

CONNECTORS=procedure call+event broadcast+database protocol+pipe 

----------------------------------分类---------------------------- 

architectural pattern=architectural idiom=architectural style 

style = pipes and filters + data abstraction and object-oriented organization + event-based or implicit invocation + lyered systems + repositories + interpreters + process control + distributed processes + main program and subroutine organizations + state transiton systems + domain-specific software architectures 

----------------------------------实际---------------------------- 

实际的软件系统往往是多种style的综合 

1. 递归。每个component还有style 

2. 多接。一个component可有多个connector 

3. 合并。to completely elaborate one level of architectural description in a completely different architectural style. 

----------------------------------pipes and filters---------------------------- 

component=filter(read streams of data on its inputs and produce streams of data on its outputs) 

connector=pipe(transmit outputs of one filter to inputs of another) 

缺点举例:往往成了批处理,交互性差 

----------------------------------data abstraction and object-oriented organization---------------------------- 

component=ADT 

connector=proc call 

缺点举例:一个obj必须知道另一个obj才能与之交互 

----------------------------------event-based or implicit invocation---------------------------- 

component=ADT or other component 

connector=envent or message 

优点举例:obj交互不必知道对方,有利于reuse和evolution 

说明:implicit invocation常和explicit invocation (proc call)一起使用以取长补短 (C++是proc call,Windows progamming是message driven,于是VC++就是两者的混合) 

----------------------------------lyered systems---------------------------- 

component=layer 

connector=proc call or protocol 

说明:client-server model和virtual machine都规于lyered systems 

优点举例:connector确定而layer有不同的实现,这正是定义标准所需要的,如OSI七层协议和X Window系统的X protocol 

----------------------------------repositories---------------------------- 

component=central data structure + a collection of independent processes 

connector=direct access (process直接访问central data) 

说明:当input stream触发independent processes执行,该repository叫database。当central data structure触发independent processes执行,该repository叫blackboard。blackboard的例子是语音识别等模式识别系统,又如一些通过agent对central data共享访问的系统。 

----------------------------------interpreters---------------------------- 

component=interpretation engine + engine state + program + program state 

connector=direct access 

说明:我理解 4 种component分别对应 处理器/寄存器/ram中的程序/ram中的变量 

说明:本style通常用来构建virtual machine,以在program基于的machine和硬件实际提供的machine之间架起一道桥梁。例如,对pascal程序员来说,他仿佛面对一台virtual pascal machine。例如,在PC上运行任天堂游戏的模拟器。 

1==========
原文(baipangpang于2001/06/16 13:12粘贴) 
很对:设计重用比代码重用更有用... 
--------------------------------------------------------------------------------
但不是更难。起码在电子商务项目中,可以通过ER模型这种静态的模型与动态的oo过程模型进行交叉分析来达到设计重用。一家之言,仅供参考。看来温昱是个有心人。