Download presentation
1
Lecture 9 Architectures and Frameworks
SWE 316: Software Design and Architecture Lecture 9 Architectures and Frameworks To understand … the goals of software architecture … the meaning of “frameworks” To be able to express a software architecture … build frameworks … complete a detailed design Ch 14 Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.
2
Process Phases Discussed in This Chapter
Introduction Deployment Arch SW Architecture DataFlow Independent VM Repository Layered 2/33 Requirements Analysis Process Phases Discussed in This Chapter Design Framework Architecture Detailed Design Implementation Key: x = main emphasis x = secondary emphasis Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.
3
The meaning of software architecture
Introduction Deployment Arch SW Architecture DataFlow Independent VM Repository Layered 3/33 The meaning of software architecture 14.1 What is a software architecture? An architecture for a software application is its high level design, enabling software engineers to gain understanding An early stage of the system design process It involves identifying major system components and their communications Represents the link between specification and design processes
4
The meaning of software architecture
Introduction Deployment Arch SW Architecture DataFlow Independent VM Repository Layered 4/33 The meaning of software architecture Architectural Design: Establishing the overall structure of a software system The design process for identifying the sub-systems making up a system and the framework for sub- system control and communication is architectural design The output of this design process is a description of the software architecture
5
Software architecture
Introduction Deployment Arch SW Architecture DataFlow Independent VM Repository Layered 5/33 Software architecture If the application is small (e.g. 10 classes) this decomposition may be considered as architecture. In UML, If the application is big (hundreds of classes) we may group the classes into packages, so Software architecture is a decomposition of application into a small number of packages (class collections) Framework: a collection of classes applicable to multiple applications
6
An Architecture for a Video Store Application
Introduction Deployment Arch SW Architecture DataFlow Independent VM Repository Layered 6/33 An Architecture for a Video Store Application Videos Rentals Customers Architecture is a high-level design
7
A Sequence for Obtaining The Class Model
Introduction Deployment Arch SW Architecture DataFlow Independent VM Repository Layered 7/33 A Sequence for Obtaining The Class Model 0. Framework (some or all pre-existing) More general 2. Create architecture -- typically use framework 3. Create remaining design classes -- to complete the class model -- possibly use framework 1. Create domain classes -- from requirements analysis
8
Models of OO Analysis and Design
Introduction Deployment Arch SW Architecture DataFlow Independent VM Repository Layered 8/33 Models of OO Analysis and Design 14.2 To express requirements, architecture & detailed design Use-case model “Do this ...” e.g.*, engage foreign character Class model “with objects of these classes ...” e.g., with Engagement … classes Target Application Data Flow model “in this way ...” e.g., character scores flow from … to … State model “reacting to these events ...” e.g., when foreign character enters * Video game example
9
Deployment Environment
Introduction Deployment Arch SW Architecture DataFlow Independent VM Repository Layered 9/33 Deployment Environment Three organizational dispositions to new systems Integrate new systems into existing systems Install support services for the first time Replace existing systems Design deployment architecture Type of infrastructure (i.e. Internet, Client/Server, Command) Hardware environment (i.e. mainframe, mid-range servers, etc.) Use existing infrastructure (i.e. single sign-on, networks, Internet access) Architectural design issues for all organizations Reliability Security Performance Usability Supportability Object-Oriented Analysis and Design with the Unified Process
10
Software Architecture
Introduction Deployment Arch SW Architecture DataFlow Independent VM Repository Layered 10/33 Software Architecture 14.3 Design goals (review) Correctness Sufficiency Robustness Flexibility Reusability Efficiency Can be handled at lower levels of design
11
Modularization, cohesion, and coupling
Introduction Deployment Arch SW Architecture DataFlow Independent VM Repository Layered 11/33 Modularization, cohesion, and coupling It is not hard to write small programs However, large applications are difficult to create The principal problem complexity Decomposing the problem (modularization) is an effective tool against complexity The designer should form a clear mental model of how the application will work at a high level then Develop a decomposition to match the mental model 14.3.2 Design Goal : Correctness/Modularity We want to decompose designs into modules, each well-knit, and depending on few others.
12
Modularization, Cohesion, and Coupling
Introduction Deployment Arch SW Architecture DataFlow Independent VM Repository Layered 12/33 Modularization, Cohesion, and Coupling Goals of software decomposition: Cohesion & Coupling Cohesion within a module is the degree to which communication takes place among the module’s elements Coupling is the degree to which modules depend directly on other modules Effective modularization is accomplished by maximizing cohesion and minimizing coupling
13
Cohesion and Coupling Fig 14.16 High cohesion Low coupling
Introduction Deployment Arch SW Architecture DataFlow Independent VM Repository Layered 13/33 Cohesion and Coupling Fig 14.16 1 2 3 4 5 6 High cohesion Low coupling High coupling Bridge component Steel truss
14
Using Façade Pattern 14/33 SW Architecture Introduction
Deployment Arch SW Architecture DataFlow Independent VM Repository Layered 14/33 Using Façade Pattern
15
Architecture and Modularization of Encounter Video Game
Introduction Deployment Arch SW Architecture DataFlow Independent VM Repository Layered 15/33 Architecture and Modularization of Encounter Video Game EncounterGame EncounterGame «facade» EncounterCharacters EncounterCast «facade» EncounterEnvironment EncounterEnvironment «facade»
16
Figure 14.19 Selecting a Basic Architecture
Introduction Deployment Arch SW Architecture DataFlow Independent VM Repository Layered 16/33 Figure Selecting a Basic Architecture 1. Develop a mental model of the application. as if it were a small application e.g., personal finance application ... … “works by receiving money or paying out money, in any order, controlled through a user interface”. 2. Decompose into the required components. look for high cohesion & low coupling … decomposes into Assets, Sources, Suppliers, & Interface. 3. Repeat this process for the components. 4. Consider using Façade for each package.
17
Architectural design process
Introduction Deployment Arch SW Architecture DataFlow Independent VM Repository Layered 17/33 Architectural design process System structuring The system is decomposed into several principal sub-systems and communications between these sub-systems are identified Control modelling A model of the control relationships between the different parts of the system is established Modular decomposition The identified sub-systems are decomposed into modules
18
Advantages of explicit architecture
Introduction Deployment Arch SW Architecture DataFlow Independent VM Repository Layered 18/33 Advantages of explicit architecture Stakeholder communication Architecture may be used as a focus of discussion by system stakeholders Large-scale reuse The architecture may be reusable across a range of systems System analysis Means that analysis of whether the system can meet its non- functional requirements is possible
19
A Classification of Software Architectures
Introduction Deployment Arch SW Architecture DataFlow Independent VM Repository Layered 19/33 A Classification of Software Architectures 14.3.4 Garlan & Shaw classification Data Flow Independent Components Virtual Machines Repositories Layered Reusability We classify architectures so as to use them for several applications.
20
1- Data Flow architecture
Introduction Deployment Arch SW Architecture DataFlow Independent VM Repository Layered 20/33 1- Data Flow architecture Data Flow Data flowing between functional elements Functional transformations process their inputs to produce outputs May be referred to as a pipe and filter model (as in UNIX shell) Variants of this approach are very common. When transformations are sequential, this is a batch sequential model which is extensively used in data processing systems Not really suitable for interactive systems
21
Example of Data Flow Architecture and Corresponding Class Model
Introduction Deployment Arch SW Architecture DataFlow Independent VM Repository Layered 21/33 Example of Data Flow Architecture and Corresponding Class Model Requirement: Maintain wired financial transactions. bank address account data Bank data record Log transaction analyze deposit deposit data withdrawal data result Architecture (data flow) Comm withdraw A Class model: Bank Account withdraw() deposit() * 1 Transaction analyze() record()
22
2- Independent component architecture
Introduction Deployment Arch SW Architecture DataFlow Independent VM Repository Layered 22/33 2- Independent component architecture Communicating processes executing in parallel occasionally communicating Client-Server architectures: Distributed system model which shows how data and processing is distributed across a range of components Set of stand-alone servers which provide specific services such as printing, data management, etc. Set of clients which call on these services Network which allows clients to access servers The Observer design pattern is of potential use in independent component architectures
23
Introduction Deployment Arch SW Architecture DataFlow Independent VM Repository Layered 23/33 Independent component architecture: an example, film and picture library Software Engineering by Sommerville, 2004
24
Independent component architecture: characteristics
Introduction Deployment Arch SW Architecture DataFlow Independent VM Repository Layered 24/33 Independent component architecture: characteristics Advantages Makes effective use of networked systems. May require cheaper hardware Easy to add new servers or upgrade existing servers Disadvantages No shared data model so sub-systems use different data organisation, data interchange may be inefficient Redundant management in each server No central register of names and services - it may be hard to find out what servers and services are available
25
4- Virtual machine architectures
Introduction Deployment Arch SW Architecture DataFlow Independent VM Repository Layered 25/33 4- Virtual machine architectures A family of applications that are all expressible with a special-purpose high-level language Interpreter + program in special-purpose language Robotic control applications The Interpreter design pattern is useful in implementing this architecture.
26
4- Repository architecture
Introduction Deployment Arch SW Architecture DataFlow Independent VM Repository Layered 26/33 4- Repository architecture Primarily built around large data collection Sub-systems must exchange data. This may be done in two ways: Shared data is held in a central database or repository and may be accessed by all sub-systems Each sub-system maintains its own database and passes data explicitly to other sub-systems When large amounts of data are to be shared, the repository model of sharing is most commonly used App 1 database App 3 App 2 Applications mostly storage,retrievals, and querying.
27
5- Layered architecture
Introduction Deployment Arch SW Architecture DataFlow Independent VM Repository Layered 27/33 5- Layered architecture Subsystems each depending one-way on another subsystem An architectural layer is a coherent collection of software artifacts Each layer uses other layers and is used by other layers Building applications layer by layer can greatly simplify the implementation process Sometimes the Template design pattern can be applied.
28
Layered Architecture 3D engine layer «uses» Role-playing game layer
Introduction Deployment Arch SW Architecture DataFlow Independent VM Repository Layered 28/33 Layered Architecture 3D engine layer «uses» Role-playing game layer Characters RolePlayingGame Layout «uses» Application layer Encounter Characters Encounter Environment Encounter Game
29
Layered Architecture Example Using Aggregation
Introduction Deployment Arch SW Architecture DataFlow Independent VM Repository Layered 29/33 Layered Architecture Example Using Aggregation Requirement: Print monthly statements Architecture: Vendor-supplied Layer Accounts Layer Ajax bank common library Layer “uses” Ajax bank printing Layer Class model: (relationships within packages and Vendor-supplied layer not shown) Accounts Ajax bank common library Account Customer AjaxLogo AjaxDisclaimer Regulations Ajax bank printing Printer Page Formatter
30
Coad-Yourdon Use of Packages
First reading 6.1 Organize into Subsystems Introduction Deployment Arch SW Architecture DataFlow Independent VM Repository Layered 30/33 Coad-Yourdon Use of Packages Example Problem domain package Interface package Data management package Task management package Figure 14.25: Coad-Yourdon Use of Packages Java.applet Java.awt Java.lang
31
Introduction Deployment Arch SW Architecture DataFlow Independent VM Repository Layered 31/33 Other architectures Control models: concerned with the control flow between sub-systems. Centralised control: one sub-system has overall responsibility for control and starts and stops other sub-systems. Example: Call-return model Event-based control: each sub-system can respond to externally generated events from other sub-systems or the system’s environment Example: Broadcast model
32
Summary What is a software architecture? Complexity
Introduction Deployment Arch SW Architecture DataFlow Independent VM Repository Layered 32/33 Summary What is a software architecture? Architecture is a high-level design Complexity Cohesion: is the degree to which communication takes place among the module’s elements (High cohesion is better) Coupling: is the degree to which modules depend directly on other modules (Low coupling is better) Classification of Software Architectures
33
14.4 Framework Next Lecture 33/33 Introduction Deployment Arch
SW Architecture DataFlow Independent VM Repository Layered 33/33 Next Lecture Framework 14.4
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.