© Lethbridge/Laganière 2001 Chapter 9: Architecting and designing software1/26 Architectural Patterns.

Slides:



Advertisements
Similar presentations
Chapter 13 Review Questions
Advertisements

9.5 Software Architecture
1 Layers Data from IBM-Rational and Craig Larman’s text integrated into these slides. These are great references… Slides from these sources have been modified.
OOAD Using the UML - Use-Case Analysis, v 4.2 Copyright  Rational Software, all rights reserved 1/18 Use Case Analysis – continued Control Classes.
GRASP Patterns M Taimoor Khan
Technical Architectures
© Lethbridge/Laganière 2001 Chapter 9: Architecting and designing software1 Layers Data from IBM-Rational and Craig Larman…
Distributed Systems Architectures
Lecture 23: Software Architectures
© Lethbridge/Laganière 2001 Chap. 3: Basing Development on Reusable Technology 1 Let’s get started. Let’s start by selecting an architecture from among.
The Architecture of Transaction Processing Systems
Software Architecture Patterns (2). what is architecture? (recap) o an overall blueprint/model describing the structures and properties of a "system"
Systems Architecture, Fourth Edition1 Internet and Distributed Application Services Chapter 13.
Application Architectures Vijayan Sugumaran Department of DIS Oakland University.
© Lethbridge/Laganière 2001 Chapter 9: Architecting and designing software1 Architectural Patterns.
System Architecture: Desing alternatives and methodologies.
Course Instructor: Aisha Azeem
Design Patterns academy.zariba.com 1. Lecture Content 1.What are Design Patterns? 2.Creational 3.Structural 4.Behavioral 5.Architectural 6.Design Patterns.
Client-Server Processing and Distributed Databases
Protocols and the TCP/IP Suite Chapter 4. Multilayer communication. A series of layers, each built upon the one below it. The purpose of each layer is.
CS 4310: Software Engineering
The Design Discipline.
©Ian Sommerville 2006Software Engineering, 8th edition. Chapter 12 Slide 1 Distributed Systems Architectures.
What is Architecture  Architecture is a subjective thing, a shared understanding of a system’s design by the expert developers on a project  In the.
1 CMPT 275 High Level Design Phase Architecture. Janice Regan, Objectives of Design  The design phase takes the results of the requirements analysis.
Copyright © 2012 Accenture All Rights Reserved.Copyright © 2012 Accenture All Rights Reserved. Accenture, its logo, and High Performance Delivered are.
An Introduction to Software Architecture
9.4 Software Architecture
2. Database System Concepts and Architecture
SOFTWARE DESIGN AND ARCHITECTURE LECTURE 07. Review Architectural Representation – Using UML – Using ADL.
4/2/03I-1 © 2001 T. Horton CS 494 Object-Oriented Analysis & Design Software Architecture and Design Readings: Ambler, Chap. 7 (Sections to start.
SAMANVITHA RAMAYANAM 18 TH FEBRUARY 2010 CPE 691 LAYERED APPLICATION.
© 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 1 Architectural Styles.
CSE 240 Lecture 12. Quote of the day “There is no reason for any individual to have a computer in his home.” Ken Olsen ( ), President, Digital Equipment,
Architectures of distributed systems Fundamental Models
Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 3: Basing Software Development on Reusable Technology.
GRASP: Designing Objects with Responsibilities
CPSC 372 John D. McGregor Module 3 Session 1 Architecture.
Unit 2 Architectural Styles and Case Studies | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS 1.
Introduction to Design Patterns Part 1. © Lethbridge/Laganière 2001 Chapter 6: Using design patterns2 Patterns - Architectural Architectural Patterns:
Enterprise Integration Patterns CS3300 Fall 2015.
1 CMPT 275 High Level Design Phase Modularization.
CPSC 871 John D. McGregor Module 3 Session 1 Architecture.
Model View Controller MVC Web Software Architecture.
CPSC 875 John D. McGregor C9 - Tactics. Tactics A tactic is a transformation Given that the pre-condition of the tactic is true The tactic defines changes.
University of Toronto at Scarborough © Kersti Wain-Bantin CSCC40 system architecture 1 after designing to meet functional requirements, design the system.
Architecture View Models A model is a complete, simplified description of a system from a particular perspective or viewpoint. There is no single view.
Web Services An Introduction Copyright © Curt Hill.
Component Patterns – Architecture and Applications with EJB copyright © 2001, MATHEMA AG Component Patterns Architecture and Applications with EJB Markus.
OOD OO Design. OOD-2 OO Development Requirements Use case analysis OO Analysis –Models from the domain and application OO Design –Mapping of model.
E-commerce Architecture Ayşe Başar Bener. Client Server Architecture E-commerce is based on client/ server architecture –Client processes requesting service.
Distributed Systems Architectures Chapter 12. Objectives  To explain the advantages and disadvantages of different distributed systems architectures.
Distributed Systems Architectures. Topics covered l Client-server architectures l Distributed object architectures l Inter-organisational computing.
And Some UML Diagrams in between
Layers Data from IBM-Rational and Craig Larman’s text integrated into these slides. These are great references… Slides from these sources have been modified.
SOFTWARE DESIGN AND ARCHITECTURE
Chapter 2: System Structures
Software Design and Architecture
CHAPTER 3 Architectures for Distributed Systems
CHAPTER 2 CREATING AN ARCHITECTURAL DESIGN.
#01 Client/Server Computing
Chapter 3: Windows7 Part 4.
Ch > 28.4.
Introduction to Design Patterns Part 1
Layers Data from IBM-Rational and Craig Larman’s text integrated into these slides. These are great references… Slides from these sources have been modified.
Software models - Software Architecture Design Patterns
An Introduction to Software Architecture
Chapter 6: Architectural Design
#01 Client/Server Computing
Presentation transcript:

© Lethbridge/Laganière 2001 Chapter 9: Architecting and designing software1/26 Architectural Patterns

© Lethbridge/Laganière 2001 Chapter 9: Architecting and designing software2/26 Architectural Patterns ‘Notion’ of an architectural pattern is essential to good architectural design. We call these architectural patterns or architectural styles. Patterns provide for flexible systems using components —Components are as independent as possible. (Hunks of executable components…) Some architectural patterns are better far better for some applications than for others. Let’s look at a few important ones.

© Lethbridge/Laganière 2001 Chapter 9: Architecting and designing software3/26 1. The Multi-Layer Architectural Pattern Layered architecture: —layers communicate down! —Normally immediately below with few ‘skips’ —Is the classical approach. —The higher layer sees the lower layers as a set of services. —This notion is fundamental to good design. —Often, a layer communicates ONLY with the layer below it not always - but normally..

© Lethbridge/Laganière 2001 Chapter 9: Architecting and designing software4/26 Multi-Layered Architectural Pattern… Built with layers at increasing levels of abstraction. —1. User Interface layer - normally first for presentation —2. Application Layer is usually immediately below UI layer and typically provides the application functions determined by application use-cases. (application layer) —3. Domain Layer is usually next and provides general domain-level services (business use-cases) —4. Services / Support (Bottom) layers provide general (but essential) services. »e.g. network communication, database access »operating system services

© Lethbridge/Laganière 2001 Chapter 9: Architecting and designing software5/26 Extremely Nice Feature of Layered Design —Layers / layer services are replaceable -NO impacting to other layers and dependencies if the interfaces remains unchanged. -Examples: »User Interface layer when porting to a different platform or for different environments. »Upgrading / enhancing / optimizing services… -We have clear separation of concerns -We have very good ‘cohesion’ of services…

© Lethbridge/Laganière 2001 Chapter 9: Architecting and designing software6/26 Example Of Multi-layer Systems (Seen Before…) Screen display facilities User account management File system Kernel (handling processes and swapping) Application programs User interface Application logic Database access Network communication Transmitting and receiving Dealing with packets Dealing with connections Dealing with application protocols a) Typical layers in an application program b) Typical layers in an operating system c) Simplified view of layers in a communication system Operating system access Communications between layers: usually use procedure calls. Upper layers become clients; lower layers become servers.

12 Multi-Tier Layered Architecture - Example © Lethbridge/Laganière 2001

6 Multi-Tier Layered Architecture - Example Layering Approach General functionality Specific functionality This is a very broad generalization. in practice, things will be considerably different and application dependent in many cases. Note: this is also a very general view; may/may not include a GUI layer. © Lethbridge/Laganière 2001

8 Multi-Tier Layered Architecture - Example Separate presentation and application logic, and other areas of concern. Consider: Different names (in some cases). Can see the main idea! UI Layer (or Presentation Layer) “Domain” or “Application Logic” Layer Services Layer Persistence Subsystem Logging Subsystem Security Subsystem (Interface may/may not be graphical…) (May/may not need both…) © Lethbridge/Laganière 2001

Chapter 9: Architecting and designing software7/26 Multi-layered Architecture And Design Principle Satisfy Eleven Architectural Design Principles) 1. Divide and conquer: layers can be independently designed. 2. Increase cohesion: Well-designed layers have layer cohesion. 3. Reduce coupling: Well-designed lower layers do not know about the higher layers and the only connection between layers is through the API. 4. Increase abstraction: you do not need to know the details of how the lower layers are implemented. 5. Increase reusability: The lower layers can often be designed generically. (e.g. those that handle database access, persistency, etc.) (different databases….)

© Lethbridge/Laganière 2001 Chapter 9: Architecting and designing software8/26 Multi-layered Architecture And Design Principle Satisfy Eleven Architectural Design Principles)* 6. Increase reuse: You can often reuse layers built by others that provide the services you need. (think: Domain Layer) 7. Increase flexibility: you can add new facilities built on lower- level services, or replace higher-level layers. 8. Anticipate obsolescence: By isolating components in separate layers, the system becomes more resistant to obsolescence. 9. Design for portability: All the dependent facilities can be isolated in one of the lower layers. As we know, some things tend to change over time; more than some other aspects of an application. 10. Design for testability: Layers can be tested independently through the interfaces exercising layer responsibilities. 11. Design defensively: The APIs of layers are natural places to build in rigorous assertion-checking. Note that this model appears to satisfy all eleven design principles!

© Lethbridge/Laganière 2001 Chapter 9: Architecting and designing software9/26 2.Client-server and other Distributed Architectural Patterns At least one component has the role of server: —waiting for and then handling connections. At least one component that has the role of client, initiating connections to obtain some service. Three-tier model for web-based client-sever applications: —Server ‘in the middle’ -server to client (web-based or not; likely communicating via the Internet) -client to a database server (usually / often via an intranet)

© Lethbridge/Laganière 2001 Chapter 9: Architecting and designing software10/26 Other Distributed Client-server Architectural Patterns Peer-to-Peer pattern. A system where: —various software components distributed over several hosts. —Hosts: both clients and servers (to each other) —Any two components can set up a communications channel through which communications is accomplished. Variation: —Sometimes peers need to be able to find each other; — May need a server containing location information

© Lethbridge/Laganière 2001 Chapter 9: Architecting and designing software11/26 An Example Of A Distributed System Client2: Server: Client1: Client3: > look up addresses > exchange messages > exchange messages > exchange messages > look up addresses

© Lethbridge/Laganière 2001 Chapter 9: Architecting and designing software12/26 How Does The Client-server Architectural Pattern Subscribe To Principles Of Good Architectural Design? 1. Divide and conquer: Dividing the system into client and server processes is a strong way to divide the system. —  Each can be separately developed. 2. Increase cohesion: Server can each provide cohesive services to clients. 3. Reduce coupling: There is usually only one communication channel exchanging simple messages. 4. Increase abstraction: Separate distributed components are often good abstractions. What does this sentence mean to you? Abstractions?? 6. Increase reuse: It is often possible to find suitable frameworks on which to build good distributed systems. Sample architectures already exist. However, client-server systems are often very application specific.

© Lethbridge/Laganière 2001 Chapter 9: Architecting and designing software14/26 3. The Broker Architectural Pattern Here, we transparently distribute aspects of the software system to different nodes —Objects call method’s other objects w/o knowing object is remotely located. —Client does not ‘care’ where the remote object is. —CORBA: well-known open standard allowing you to build this kind of architecture. -(Common Object Request Broker Architecture) -(Microsoft has its own architecture: COM, DCOM (old)) -‘Proxy design pattern’ can be used such that a proxy object calls the broker, which determines where the desired object is located.

© Lethbridge/Laganière 2001 Chapter 9: Architecting and designing software15/26 Example of a Broker system Note that all these architectural patterns are illustrated using ‘components.’ Very popular design pattern. Simple and very effective.

© Lethbridge/Laganière 2001 Chapter 9: Architecting and designing software16/26 Broker Architecture And How This Architectural Design Pattern Subscribes To Design Principles 1. Divide and conquer: The remote objects can be independently designed. 5. Increase reusability: It is usually possible to design the remote objects so that other systems can use them too. We see this all the time on the Internet. 7. Design for flexibility: The brokers can be updated as required, or the proxy can communicate with a different remote object. 9. Design for portability: You can write clients for new platforms while still accessing brokers and remote objects on other platforms. 11. Design defensively: You can provide careful assertion checking in the remote objects. Note that there are fewer design principles satisfied. Does NOT make this pattern inferior! (coherence; coupling; obsolescence, more…)

© Lethbridge/Laganière 2001 Chapter 9: Architecting and designing software17/26 4. Transaction-Processing Architectural Pattern A process reads a series of inputs one by one. Each input describes a transaction – a command that typically (for example) might change some data stored by the system Normally transactions come in one-by-one. generally atomic. Do this, then that, then another thing. Add, Change, Delete… A transaction dispatcher briefly processes a transaction and ‘hands’ that transaction to a specific transaction handler designed to specifically ‘handle’ that kind of transaction. The transaction handler is specifically designed and implemented to handle ‘a’ specific type of transaction.

Transactions within a single program architecture

© Lethbridge/Laganière 2001 Chapter 9: Architecting and designing software18/26 Transaction Dispatchers – Some Complexity Comments: In a threaded environment, where many transactions may be ‘in process,’ data to be modified must be locked and released as appropriate. Additional complexity. Particularly complicated when an application needs to perform a query prior to an update transaction all the while ensuring that the data is not changed… See database books on the details. (record / attribute lockout)

© Lethbridge/Laganière 2001 Chapter 9: Architecting and designing software19/26 Example of a Transaction-Processing System Transaction input Transaction dispatcher transactions Handler for Reservation transaction Handler for Flight cancellation transaction Recognize that these ‘components’ might exist on a local device or remotely. The ‘component’ may simply be an implementation of some design subsystem. At a higher level – the application architecture rather than a program architecture:

© Lethbridge/Laganière 2001 Chapter 9: Architecting and designing software20/26 The Transaction-Processing Architecture And Design Principles (As Usual, These Are Very Good..) 1. Divide and conquer: The transaction handlers are suitable system divisions that can be given to separate software engineers for detailed design and development. 2. Increase cohesion: Transaction handlers are naturally cohesive units. A ‘hander’ accommodates only ‘that’ transaction.’ 3. Reduce coupling: Separating the dispatcher from the handlers clearly reduces coupling. 7. Design for flexibility: One may readily add new transaction handlers to handle additional transactions. 11. Design defensively: One may add assertion checking in each transaction handler and/or in the dispatcher. Note: several principles missing here too….Design Decisions!!

© Lethbridge/Laganière 2001 Chapter 9: Architecting and designing software21/26 5. The Pipe-and-Filter Architectural Pattern Streams of data, in a relatively simple format, passed through series of processes Data constantly fed into a pipeline; Each component transforms the data in some way. The processes work concurrently. Constant data in and coming out. Very flexible architecture. —Almost all the components could be removed. —Components may added, changed, deleted, reordered… Very flexible particularly (for example) as in converting data or filtering out (removing) characters or ‘features’, etc. Sometimes (oftentimes) data might undergo a series of transformations… Can also split pipelines or join pipelines together.

© Lethbridge/Laganière 2001 Chapter 9: Architecting and designing software22/26 Example Of A Pipe-and-filter System encoders for microphone input encoder for ambient noise cancel noise equalize dynamic range remove non-voice frequencies compresstransmit receivedecompress encode speaker output microphones near sound source distant microphone cancel echo TCP/IP Transmission One pipe starts here… Another pipeline starts here… Pipelines join here Think in terms of manufacturing processes, process control applications or a GPS system. Used more frequently in scientific/engineering systems than in information systems applications. Note: questionable architecture for an information system…. Note the concurrency…

© Lethbridge/Laganière 2001 Chapter 9: Architecting and designing software23/26 Pipe-and-Filter Architecture: Design Principles 1. Divide and conquer: The separate processes can be independently designed. Excellent for manufacturing / process control / etc. systems. 2. Increase cohesion: The processes have functional cohesion. (single input; single output; no side effects…) 3. Reduce coupling: The processes have only one input and one output. 4. Increase abstraction: The pipeline components are often good abstractions, hiding their internal details. And components are usually replacable! 5. Increase reusability: The processes can often be used in many different contexts. 6. Increase reuse: It is often possible to find reusable components to insert into a pipeline.

© Lethbridge/Laganière 2001 Chapter 9: Architecting and designing software24/26 6. The Model-View-Controller (MVC) Architectural Pattern Architectural pattern to help separate user interface layer from other parts of the system Great way to have layered cohesion, as interfaces or controlled. Coupling reduced between UI layer and rest of system. Very popular architectural pattern….  THE MVC pattern separates the  Model: the functional layer (business entities, ‘key  abstractions,’ the objects, relations,...) from the  View: the user interface and the  Controller; the director / sequencer of the activities in response to the user.  Why are the business entities called the Model??

© Lethbridge/Laganière 2001 Chapter 9: Architecting and designing software25/26 MVC Architectural Pattern The model contains the underlying classes whose instances (objects) are to be viewed and manipulated —Model will likely contain classes from the business domain that may be general and form the application itself (may be inherited), which may be unique or specialized to the application. —These may be very complicated software objects. The view contains objects used to render the appearance of the data from the model in the user interface and the controls with which an actor can interact. The controller contains the objects that control and handle the user’s interaction with the view and the model. —Controller contains business logic…and response to events. (The Observable design pattern is normally used to separate the model from the view (later) )

© Lethbridge/Laganière 2001 Chapter 9: Architecting and designing software26/26 Example of the MVC architecture for the UI MVC exhibits layered cohesion, as the model has no idea what view and controller are attached to it (doesn’t care!). Model is ‘passive’ in this respect. The View (UI), business services (controller), and model (business entities / core abstractions) will reside in different architectural layers. There may be special cases when no controller component is created, but the separation of the model from the view is still essential. (from perspective of the Controller…) Discuss the arrows…and their directions…

© Lethbridge/Laganière 2001 Chapter 9: Architecting and designing software27/26 The MVC Architecture and Design Principles 1. Divide and conquer: Three components can be somewhat independently designed. 2. Increase cohesion: Components have stronger layer cohesion than if the view and controller were together in a single UI layer. 3. Reduce coupling: Minimal communication channels among the three components. 6. Increase reuse: The view and controller normally make extensive use of reusable components for various kinds of UI controls. 7. Design for flexibility: It is usually quite easy to change the UI by changing the view, the controller, or both. 10. Design for testability: Can test application separately from the UI. Know These!