目的 : expresses a fundmental structural organization schema for software systems. It provides a set of predefined sybsystems, specifies their responsibilities, and include rules and guidelines for organizing the relationships between them.
Layer Structure
Example : OSI 7 layer network protocol
- Class Layer J
- Collaborator Layer J-1
- Responsibility
- Provides services used by layer J+1
- Delegates subtask to layer J-1
特色:
1. 重專精
2. 適合具有一個完整且明確的中心產品的大型公司,由多個team的大型分工結構所組合而成
相容組織模式
Pipe and Filter (For Compiler, UNIX Stream I/O)
Example :
(ASCII program text) => Lexical Analysis/Scanner =>
(token stream) => Syntactic Analysis/Parser =>
(abstract syntax tree) => Semantic Analysis => (augmented abstract syntax tree)
- Intermediate Code Generation
(Au Lait Program)
Optimization
(Optimized Au Lait Program)
MIPS backend, Intel backend, SPARC backend, Virtual Machine
Class
Filter Collaborator
Pipe
Responsibility
Get input data
Perform a function on its input data
Supplies output data
Class
Pipe Collaborator
Filter
Responsibility
Transfer data
Buffers data
Synchronize active neighbors
Blackboard ( For knowledge base system, experimental system )
Class
Blackboard Collaborator
—-
Responsibility
Manage central data (inspect and update)
Class
Knowledge Source Collaborator
Blackboard
Responsibility
Evaluate its own applicability (Update blackboard, execute condition, execute action)
Compute a result
Update Blackboard
Class
Control Collaborator
—-
Responsibility
Monitor Blackboard
Schedules knowledge source activation
特色:
1. 具彈性
2. 與扁平型組織相容
3. 適合小型的 team work 組織,分散式授權的公司以及研究機構。
相容組織模式
Broker ( For 3 tier Client - Server Architecture )
Class
Client Collaborator
Client-size proxy
Broker
Responsibility
Implements user functionality
Send requests to server through a client-side proxy
Class
Client-Side Proxy Collaborator
Client
Broker
Responsibility
Encapsulate system-specific functionality
Mediate between the client and the broker
Class
Broker Collaborator
Client
Server
Client-side proxy
Server-side proxy
Bridge
Responsibility
(Un-)registers server
Offers API
Transfer messages
Error recovery
Interoperates with other brokers
Class
Bridge Collaborator
Broker
Bridge
Responsibility
Encapsulate network specific functionality
Mediate between the broker and the bridge of a remote broker
Class
Server-Size Proxy Collaborator
Server
Broker
Responsibility
Calls services with-in the server
Encapsulate system specific functionality
Mediates between the server and the broker
Class
Server Collaborator
Server-side proxy
Broker
Responsibility
Implements services
Register itself with the local brocker
Send response and exception back to the client through a server-side proxy
Model View Controller
Class
Model Collaborator
View
Controller
Responsibility
Provide functional core of the application
Registers dependent views and controllers
Notify dependent components about data changes
Class
View Collaborator
Controller
Model
Responsibility
Create and initialize its associated controller
Display Information to the user
Implements the update procedure
Retrieves data from the model
Class
Controller Collaborator
View
Model
Responsibility
Accept user input as events
Translates events to service requests for the model or display request for the view
Implement the update procedure if required
Presentation-Abstraction-Control = Agent
Class
Agent(Coordinator) Collaborator
Higher Level Agent
This Level Agent
Lower Level Agent
Responsibility
Coordinates lower-level PAC agents
Compose lower level PAC agent to a single unit of higher abstraction
Class
Abstraction Collaborator
Coordinator
Responsibility
Core Data Keep
Provided Core Data Management API
Class
Control Collaborator
Coordinator
Abstraction
Presentation
Responsibility
Accept user input as events
Send/Receive Message to/from Abstraction
Refresh Presentation
Class
Presentation Collaborator
Control
Responsibility
Provide display function (update, open, close, zoom, move, print)
Micro kernel ( For OS)
Class
Internal Server Collaborator
Micro Kernel
Responsibility
Implements additional services
Encapsulates some system specifics
Class
Micro kernel Collaborator
Internal Server
Responsibility
Provides core mechanism
Offer Communication facilities
Encapsulates system dependencies
Manages and control resources
Class
External Server Collaborator
Micro kernel
Responsibility
Provide programming interfaces for its clients
Class
Adapter Collaborator
External Server
Micro kernel
Responsibility
Hides system dependencies such as communication facilities from the client
Invokes methods of external servers on behalf of client
Class
Client Collaborator
Adapter
Responsibility
Represents an application.
Reflection
Class
Base Level Collaborator
Meta Level
Responsibility
Implements the application logic
Uses information provided by the meta level
Class
Meta-Level Collaborator
Base-Level
Responsibility
Encapsulates system Internals that may change.
Provides an interface to facilitate modifications to the meta-level
Master - Slave (Divide & Conquer)
Class
Master Collaborator
Slave
Responsibility
Partition work among several slave component
Start the execution of slave
Compute a result from the sub-result the slaves return
Class
Slave Collaborator
—-
Responsibility
Implement the sub-service used by the master
Idiom
目的 : low-level pattern specific to a programming language. An idiom describes how to implement particular aspects of components or the relationship between them using the feature of the given language.
|
Architectural Pattern |
Design Pattern |
Idioms |
From Mud to Structure |
Layers, Pipe and Filter, Black Board |
Interpreter |
|
Distributed System |
Broker, Pipe and Filter, Micro Kernel |
|
|
Interactive System |
Model / View / Controller (MVC), Presentation / Abstraction / Control (PAC) |
|
|
Adaptable System |
Microkernel, Reflection |
|
|
Creation |
|
Abstract Factory, Prototype, Builder |
Singleton, Factory Method |
Structural Decomposition |
|
Whole - Part, Composite |
|
Organization of Word |
|
Master - Slave, Chain of Responsibility, Command, Mediator |
|
Access Control |
|
Proxy, Façade, Iterator |
|
Service Variation |
|
Bridge, Strategy, State |
Template Method |
Service Extension |
|
Decorator, Visitor |
|
Management |
|
Command Processor, View Handler, Momento |
|
Adaptation |
|
Adapter |
|
Communication |
|
Publisher-Subscriber, Forwarder-Receiver, Client-Dispatcher-Server |
|
Resource Handling |
|
Flyweight |
Counted Pointer |
Facebook
Post preview:
Close preview