Pattern的研究情况 关于 patterni研究的历史 A Pattern Language, Christopher Alexander, 1977 Advanced C++: Programming Styles and Idioms James Coplien, 1992 Design Patterns: Elements of Reusable Object Oriented Software", GOF, 1995 'Pattern-Oriented Software Architecture: A System of Patterns'”(简称为“POSA”),GoV,1996
KL$ MNOP &,, ! -.// 0 1 22 &,,3" 4 5 6 -..7 0,&89##:; 3 5 < -..= 0&; 3 8 3" &5'/010&3 5+ < -..> ?$$$
Pattern的研究现状 pattern与Java pattern与 CORBA pattern与系统结构 pattern generic programming结合 其他
$ F*+ $ F,-# $ FQRS- $ F"'$" "S+ TU
POSA中的模式分类 Architectural patterns 表达了软件系统的基本结构组织形式或者结构方案 它包含一组预定义的子系统,规定了这些子系统的责任,同 时还提供了用于组织和管理这些子系统的规则和向导。 Design Patterns 为软件系统的子系统、组件或者组件之间的关系提供一个精 炼之后的解决方案。 它描述了在特定环境下,用于解决通用软件设计问题的组件 以及这些组件相互通信时的可重现结构。 · Idioms 是一个与编程语言相关的低级模式。 它描述了如何实现组件的某些功能,或者利用编程语言的特 性来实现组件内部要素之间的通信功能
& bcdN:eHf01Mghij01+, klmMn"op:e q"QRp:ers t uvVwMg2 QRp:eqx2yz ,& SdN:ep:e MNijMN569:W{ |5})*+, k~E!"FG Vw)*VdN&'MN QRMN34uXY01 4 BW;>?39 k~KMNR ijV>?! ]MN56
POSA: Architectural Patterns(1) Architectural Patterns are very high-level structural patterns Also called"Conceptual Patterns From Mud to Structure: Organize components Layers: Organize components into layers where layer i's services are only used by layer i+I Pipes and Filters: Divide the task into several sequential processin steps --the output of task i is the input of task i+1 Blackboard: Several independent programs work cooperatively on a common data structure Distributed Systems: Handle distributed computation Broker: Introduce a broker component toto achieve better decoupling of clients and servers -brokers accept requests from clients and forward the requests to servers, then return the results back to the clients
%) &1",;1$ 0 & 5 38,@$ - * . $ /01 2 - & ,$ 33$ $! & $! &/01 4&-5 & $$1 # 3"8% # $ 4&-% $& $ ! 33& ,$ ! !,$ ) $ $ & 1
POSA: Architectural Patterns(2) Interactive Systems Keep a program's functional core independent of the user interface Model-View -Controll: Divides the application into processing, output, and input. View and controller parts are usually observers of the model via the observer pattern Presentation- Abstract-Control: Divides the application up to heirarchies or MvC-like components. Each component is dependent upon and and provides functionality for the a higher level component. There is only one top-level component Adaptable Systems: Design for change Microkernel Encapsulate the fundamental services of the application Reflection divide the application into a meta-level and a base level to make the application"self-aware". The meta level encapsulates knowledge of the system; the base level encapsulates knowledge about the problem domain
%) 413"8A,) $ 633 - ) $ $) $1 $ $ ! 1 3 3 - $ 63& 1 $ !$ !3 17 3 1 #3"8,,$ 6& $!$ ! 1 "! 3 & 8 !3817 $ & ! # $ & $ 1