University of Toronto University of Toronto Department of Computer Science Pipe and filter Lecture 23 Software Architectures Department of Computer Science Source Adapted from Shaw Garlan 1996 p21 2 See also van Vliet 1999 Pp266 7 and p279 pipe filter pipe filter filter pipe Architectural Styles pipe filter Pipe and filter pipe filter pipe filter pipe Object oriented Client Server Object Broker Event based Layered pipe pipe Examples UNIX shell commands Designing Layered Architectures Compilers Repositories Lexical Analysis parsing semantic analysis code generation Blackboard MVC Signal Processing Process control Interesting properties filters don t need to know anything about what they are connected to filters can be implemented in parallel behaviour of the system is the composition of behaviour of the filters specialized analysis such as throughput and deadlock analysis is possible 1 Easterbrook 2004 University of Toronto 2 Easterbrook 2004 University of Toronto Department of Computer Science Object Oriented Architectures Department of Computer Science Variant 1 Client Server client method invocation client object method invocation abstract data types method invocation Interesting properties Is a special case of the previous pattern object oriented architecture Interesting properties Clients do not need to know about one another data hiding internal data representations are not visible to clients can decompose problems into sets of interacting agents can be multi threaded or single thread method invocation method invocation Server Examples object method invocation object object object method invocation client Source Adapted from Shaw Garlan 1996 p22 3 Disadvantages Client objects must know the identity of the server Disadvantages objects must know the identity of objects they wish to interact with Easterbrook 2004 3 Easterbrook 2004 4 1 University of Toronto University of Toronto Department of Computer Science Variant 2 Object Brokers Broker Architecture Example client broker server server client client Department of Computer Science Interesting properties Adds a broker between the clients and servers Clients no longer need to know which server they are using Can have many brokers many servers Disadvantages Broker can become a bottleneck Degraded performance 5 Easterbrook 2004 University of Toronto 6 Easterbrook 2004 University of Toronto Department of Computer Science Department of Computer Science Event based implicit invocation Layered Systems Source Adapted from Shaw Garlan 1996 p23 4 See also van Vliet 1999 Pp264 5 and p278 announce event agent agent Examples agent broadcast broadcast medium medium listen for event Source Adapted from Shaw Garlan 1996 p25 See also van Vliet 1999 p281 application layer listen for event announce event utilities users communication protocols database management systems for data integrity checking graphical user interfaces Interesting properties Support enhancement add functionality and re use can define standard layer interfaces Supports re use and evolution of systems add new agents easily Disadvantages Components have no control over ordering of computations Easterbrook 2004 Interesting properties Support increasing levels of abstraction during design announcers of events don t need to know who will handle the event Examples Operating Systems debugging systems listen for particular breakpoints kernal agent Disadvantages May not be able to identify clean layers 7 Easterbrook 2004 8 2 University of Toronto University of Toronto Department of Computer Science Variant 3 layer data access Department of Computer Science Open vs Closed Layered Architecture Presentation layer Java AWT Appl n Views Layer N Layer N 1 closed architecture each layer only uses services of the layer immediately below Minimizes dependencies between layers and reduces the impact of a change Layer 2 Layer 1 Application Logic layer Business logic Contol objects open architecture a layer can use services from any lower layer Layer N Layer N 1 More compact code as the services of lower layers can be accessed directly 9 Easterbrook 2004 University of Toronto Layer 2 Layer 1 Breaks the encapsulation of layers so increase dependencies between layers File Mgmnt Query Engine DBMS Storage layer 10 Easterbrook 2004 University of Toronto Department of Computer Science Department of Computer Science How many layers Repositories Source Adapted from Shaw Garlan 1996 p26 7 See also van Vliet 1999 p280 Application client 2 layers database layer e g simple client server model Business Logic Database separate out the business logic helps to make both user interface and database layers modifiable 4 layers Presentation layer user interface Separates applications from the domain entities that they use boundary classes in presentation layer control classes in application layer entity classes in domain layer Partitioned 4 layers identify separate applications agent Presentation layer user interface 3 layers Examples blackboard expert systems programming environments Database UI2 UI3 UI4 App1 App2 App3 App4 agent agent databases Domain Entities UI1 blackboard shared data agent Applications Interesting properties can choose where the locus of control is agents blackboard both reduce the need to duplicate complex data Domain Entities Database Easterbrook 2004 agent agent Database server application layer 11 Disadvantages blackboard becomes a bottleneck Easterbrook 2004 12 3 University of Toronto University of Toronto Department of Computer Science Variant Model View Controller propagate update controller update access model controller access Model View Controller Example view view propagate Department of Computer Science Properties One central model many views viewers Each view has an associated controller The controller handles updates from the user of the view Changes to the model are propagated to all the views 13 Easterbrook 2004 University of Toronto 14 Easterbrook 2004 University of Toronto Department of Computer Science Department of Computer Science MVC Component Interaction Process Control Source Adapted from Shaw Garlan 1996 p27 31 input variables control parameters controller manipulated variables Examples s or ns se process actuators controlled variables aircraft spacecraft flight control systems controllers for industrial production lines power stations etc chemical engineering Interesting properties separates control policy from the controlled process handles real time reactive
View Full Document
Unlocking...