Download presentation
Presentation is loading. Please wait.
Published byJasmine Brooks Modified over 9 years ago
1
SS ZG653Second Semester 2012-13 1 Topic Architectural Patterns – Review of Patterns
2
SS ZG653Second Semester 2012-13 2 What is a Pattern A pattern for software architecture describes a particular recurring design problem that arises in specific design contexts, and represents a well-proven generic scheme for its solution. The solution scheme is specified by describing its constituent components, their responsibilities and relationships, and the ways in which they collaborate – Buschmann, F. et al, Pattern Oriented Software Architecture – Volume1, Wiley, 1996
3
SS ZG653Second Semester 2012-13 3 Pattern – Three-part Schema Pattern Context Problem Solution A situation giving rise to a problem The recurring problem arising in that context A proven solution of the problem
4
SS ZG653Second Semester 2012-13 4 Patterns – Three Categories Architecture Design Idiom Refined Implementation
5
SS ZG653Second Semester 2012-13 5 Architectural Patterns Mud to Structure Distributed Systems Interactive Systems Adaptive Systems Layers Pipes and Filters Blackboard Layers Pipes and Filters Blackboard Model-View-Controller Presentation-Abstraction- Control Model-View-Controller Presentation-Abstraction- Control Broker Microkernel Reflection Microkernel Reflection
6
SS ZG653Second Semester 2012-13 6 Mud to Structure
7
SS ZG653Second Semester 2012-13 7 LAYERED ARCHITECTURAL STYLE Mud to Structure
8
SS ZG653Second Semester 2012-13 8 Layers The layers architectural pattern helps to structure application that can be decomposed into groups of subtasks in which each group of subtasks is at a particular level of abstraction
9
SS ZG653Second Semester 2012-13 9 Layers Implementing protocols Conceptually different issues split into separate, interacting layers Functionality decomposed into layers; helps replace layer(s) with better or different implementation
10
SS ZG653Second Semester 2012-13 10 Layers – 3 part schema Pattern Context A large system that requires decomposition ProblemMix of low- and high-level issues, where high-level operations rely on low-level ones A typical pattern of communication flow consists of requests moving from high level to low level, and answers to requests, incoming data and notification about events traveling in the opposite direction Forces Code changes should not ripple through the system Stable interfaces; standardisation Exchangeable parts Grouping of responsibilities for better understandability and maintainability SolutionStructure the system into appropriate number of layers
11
SS ZG653Second Semester 2012-13 11 OSI 7-Layer Model Physical Data Link Network Transport Session Presentation Application Layer 1 Layer 2 Layer 3 Layer 4 Layer 5 Layer 6 Layer 7 Transmits bits: velocity, bit-code, connection etc. Detects and corrects errors in bit sequences Selects route from sender to receiver Breaks messages into packets and guarantees delivery Provides dialog control and synchronization facilities Structures information and attaches semantics Provides miscellaneous protocols for common activities
12
SS ZG653Second Semester 2012-13 12 Layers Main characteristic is services of Layer J are only used by Layer J+1 No further direct dependencies between layers Each layer may be further composed of many components Class Layer J Responsibility Provides services user by Layer J+1 Delegates subtasks to Layer J-1 Collaborators Layer J-1
13
SS ZG653Second Semester 2012-13 13 Layers Layer 1 Layer N-1 Layer N Client
14
SS ZG653Second Semester 2012-13 14 Layers - Detailed
15
SS ZG653Second Semester 2012-13 15 Dynamics Scenario I – Top Down communication – Client issues a request to Layer N – Layer N, cannot carry out the request on its own, it calls Layer N-1 – N-1 to N-2 till Layer 1 is reached
16
SS ZG653Second Semester 2012-13 16 Dynamics Scenario II – Bottom Up communication – Chain of actions starts from Layer 1 – Translates events to internal format and reports to Layer 2 – Notifications flow till the topmost layer and then processed
17
SS ZG653Second Semester 2012-13 17 Dynamics Scenario III – Top Down Communication – Request may not reach the bottom most layer
18
SS ZG653Second Semester 2012-13 18 Dynamics Scenario IV – Bottom Up Communication – Request may not reach the top most layer
19
SS ZG653Second Semester 2012-13 19 Dynamics Scenario V – Involves two stacks communication with each other Layer 1 Layer N-1 Layer N Layer 1 Layer N-1 Layer N
20
SS ZG653Second Semester 2012-13 20 Implementation Steps #Steps 1Define the abstraction criteria 2Determine the numbers of abstraction levels 3Name the layers and assign tasks to each of them 4Specify the services 5Refine the layering 6Specify an interface for each layer 7Structure individual layers 8Specify the communication between adjacent layers 9Decouple adjacent layers 10Design error handling strategy
21
SS ZG653Second Semester 2012-13 21 1: Define abstraction criteria Use various paradigms to arrive at an abstraction criteria Degree of customization for specific domains Degree of conceptual complexity An Example [Ordered from Top to Bottom]– -User-visible elements -Specific Application Modules -Common Service Levels -OS Interface Level -Hardware
22
SS ZG653Second Semester 2012-13 22 2: Determine the no. of abstraction levels Typically each abstraction level is one layer Map the abstraction levels to layers; one-one may not be as obvious Use mechanisms to keep number of layers to optimum number Too Few Layers Can Result in Poor Structure Too Many Layers Impose Unnecessary Overhead
23
SS ZG653Second Semester 2012-13 23 3: Name the layers and assign tasks Use a top down or bottom up approach to assign tasks Requires experience to achieve this
24
SS ZG653Second Semester 2012-13 24 4: Specify the services Strict separation of layers No component should spread over two layers Inverted pyramid of use
25
SS ZG653Second Semester 2012-13 25 5: Refine the layering Iterate to arrive at the best possible number and functionality of layers Define components and services and impose structure of layers should be avoided
26
SS ZG653Second Semester 2012-13 26 6: Specify an interface for each layer Use a black box approach Layer N does treats Layer N-1 as a black box
27
SS ZG653Second Semester 2012-13 27 7: Structure individual layers Focus should be on proper relationships between layers Individual layers should not be a chaos Structure the individual layers thru decomposition Make use of other patterns (bridge, strategy) Bridge Pattern Supports multiple implementations of services provided by a layer Strategy Pattern Supports Dynamic exchange of algorithms used by a user
28
SS ZG653Second Semester 2012-13 28 8:Specify communication bet. Adja. layers Use of push pull mechanism Use of call backs
29
SS ZG653Second Semester 2012-13 29 9: Decouple adjacent layers Lower layer is not aware of higher layer Higher layer is aware of lower layer Changes in Layer J can ignore the presence and identity of Layer J+1 [ Suitable for Top-up communication] Use of call backs
30
SS ZG653Second Semester 2012-13 30 10: Design an error handling strategy Define an efficient strategy Handling may be expensive – errors need to propogate
31
SS ZG653Second Semester 2012-13 31 Variants Relaxed Layered System Layering Through Inheritance
32
SS ZG653Second Semester 2012-13 32 Benefits Reuse of layers Support for standardisation Dependencies are kept local Exchangeability
33
SS ZG653Second Semester 2012-13 33 Liabilities Cascades of changing behaviour Lower efficiency Unnecessary work Difficulty in establishing the correct granularity
34
SS ZG653Second Semester 2012-13 34 Known Uses Virtual Machines APIs Information Systems Windows NT Find (at least 2) more popular uses and document them
35
SS ZG653Second Semester 2012-13 35 Layers PatternDescription Context A large system that requires decomposition ProblemMix of low- and high-level issues, where high-level operations rely on low-level ones A typical pattern of communication flow consists of requests moving from high level to low level, and answers to requests, incoming data and notification about events traveling in the opposite direction Forces Code changes should not ripple through the system Stable interfaces; standardisation Exchangeable parts Grouping of responsibilities for better understandability and maintainability SolutionStructure the system into appropriate number of layers VariantsRelaxed Layered System Layering Through Inheritance BenefitsReuse of layers Support for standardisation Dependencies are kept local Exchangeability LiabilitiesCascades of changing behaviour Lower efficiency Unnecessary work Difficulty in establishing the correct granularity
36
SS ZG653Second Semester 2012-13 36 Layers Quick Reference PatternDescription Context A large system that requires decomposition ProblemMix of low- and high-level issues, where high-level operations rely on low-level ones A typical pattern of communication flow consists of requests moving from high level to low level, and answers to requests, incoming data and notification about events traveling in the opposite direction Forces Code changes should not ripple through the system Stable interfaces; standardisation Exchangeable parts Grouping of responsibilities for better understandability and maintainability SolutionStructure the system into appropriate number of layers VariantsRelaxed Layered System Layering Through Inheritance BenefitsReuse of layers Support for standardisation Dependencies are kept local Exchangeability LiabilitiesCascades of changing behaviour Lower efficiency Unnecessary work Difficulty in establishing the correct granularity #Steps 1Define the abstraction criteria 2Determine the numbers of abstraction levels 3Name the layers and assign tasks to each of them 4Specify the services 5Refine the layering 6Specify an interface for each layer 7Structure individual layers 8Specify the communication between adjacent layers 9Decouple adjacent layers 1010 Design error handling strategy Class Layer J Responsibilit y Provides services user by Layer J+1 Delegates subtasks to Layer J-1 Collaborators Layer J-1 Layer 1 Layer N-1 Layer N Layer 1 Layer N-1 Layer N
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.