0% found this document useful (0 votes)
2 views

Software Architecture

The document outlines the principles of software design and architecture, emphasizing the importance of understanding software architecture, frameworks, and the design process. It discusses various architectural models including data flow, independent components, virtual machines, repositories, and layered architectures, along with their advantages and disadvantages. The document also highlights the significance of modularization, cohesion, and coupling in managing complexity within software systems.

Uploaded by

Rana Ammar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Software Architecture

The document outlines the principles of software design and architecture, emphasizing the importance of understanding software architecture, frameworks, and the design process. It discusses various architectural models including data flow, independent components, virtual machines, repositories, and layered architectures, along with their advantages and disadvantages. The document also highlights the significance of modularization, cohesion, and coupling in managing complexity within software systems.

Uploaded by

Rana Ammar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 32

SWE 316: Software Design and Architecture

Teacher: Dr. Khurram Zeeshan Haider


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

Adapted from Software Design: From


Programming to Architecture by Eric J.
Braude (Wiley), with permission.
Introductio Deployment SW DataFlo Independen Repositor 2/33
VM Layered
n Arch Architecture w t y

Requirements Process Phases Discussed in This Chapter


Analysis
Design
Framework Architecture Detailed Design

Key: x = main emphasis x = secondary emphasis Implementation

Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley), with permission.
Introductio Deployment SW DataFlo Independen
VM
Repositor
Layered 3/33
n Arch Architecture w t y

The meaning of software architecture


• 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
Introductio Deployment SW DataFlo Independen
VM
Repositor
Layered 4/33
n Arch Architecture w t y

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
Introductio Deployment SW DataFlo Independen
VM
Repositor
Layered 5/33
n Arch Architecture w t y

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
Introductio Deployment SW DataFlo Independen
VM
Repositor
Layered 6/33
n Arch Architecture w t y

An Architecture for a Video Store Application

Videos Rentals

Customers

Architecture is a high-level design


Introductio Deployment SW DataFlo Independen
VM
Repositor
Layered 7/33
n Arch Architecture w t y

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
1. Create domain classes -- possibly use framework
-- from requirements analysis
Introductio Deployment SW DataFlo Independen
VM
Repositor
Layered 8/33
n Arch Architecture w t y

Models of OO Analysis and Design


To express requirements, architecture & detailed design

Use-case model Class model


“Do this ...” “with objects of these classes ...”
e.g.*, engage foreign character e.g., with Engagement … classes

Target
Application

Data Flow model State model


“in this way ...” “reacting to these events ...”
e.g., character scores flow from e.g., when foreign character enters
… to …
* Video game example
Introductio Deployment SW DataFlo Independen
VM
Repositor
Layered 9/33
n Arch Architecture w t y

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
Introductio Deployment SW DataFlo Independen
VM
Repositor
Layered 10/33
n Arch Architecture w t y

Software Architecture
• Design goals (review)
– Correctness
– Sufficiency Can be handled
– Robustness at lower levels of
design
– Flexibility
– Reusability
– Efficiency
Introductio Deployment SW DataFlo Independen
VM
Repositor
Layered 11/33
n Arch Architecture w t y

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
Introductio Deployment SW DataFlo Independen
VM
Repositor
Layered 12/33
n Arch Architecture w t y

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
Introductio Deployment SW DataFlo Independen
VM
Repositor
Layered 13/33
n Arch Architecture w t y

Cohesion and Coupling


1 component

2 3 4

component

High cohesion 5 Bridge 6 Low coupling

 

component
Steel
truss

High coupling 
Introductio Deployment SW DataFlo Independen
VM
Repositor
Layered 14/33
n Arch Architecture w t y

Using Façade Pattern


Introductio Deployment SW DataFlo Independen
VM
Repositor
Layered 15/33
n Arch Architecture w t y

Architecture and Modularization of Encounter Video Game

EncounterGame

EncounterGame
«facade»
EncounterCharacters

EncounterCast
«facade» EncounterEnvironment

EncounterEnvironment
«facade»
Introductio Deployment SW DataFlo Independen
VM
Repositor
Layered 16/33
n Arch Architecture w t y

Figure 14.19 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
– e.g., personal finance application ...
– … decomposes into Assets, Sources, Suppliers, & Interface.
3. Repeat this process for the components.
4. Consider using Façade for each package.
Introductio Deployment SW DataFlo Independen
VM
Repositor
Layered 17/33
n Arch Architecture w t y

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
Introductio Deployment SW DataFlo Independen
VM
Repositor
Layered 18/33
n Arch Architecture w t y

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
Introductio Deployment SW DataFlo Independen
VM
Repositor
Layered 19/33
n Arch Architecture w t y

A Classification of Software Architectures

 Garlan & Shaw classification 14.3.4


 Data Flow
 Independent Components
 Virtual Machines
 Repositories
 Layered Reusability
We classify architectures
so as to use them for
several applications.
Introductio Deployment SW DataFlo Independen
VM
Repositor
Layered 20/33
n Arch Architecture w t y

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
Introductio Deployment SW DataFlo Independen
VM
Repositor
Layered 21/33
n Arch Architecture w t y

Example of Data Flow Architecture and Corresponding Class Model

Requirement: Maintain wired financial transactions.


account data Architecture
account data
deposit (data flow)
transaction
account data deposit data result
Bank transaction
analyze record Log
data transaction
withdrawal data transaction
Comm result

bank address
withdraw
account data
A Class model:
Transaction Account
Bank analyze() withdraw()
1 record() * deposit()
Introductio Deployment SW DataFlo Independen VM
Repositor
Layered 22/33
n Arch Architecture w t y

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
Introductio Deployment SW DataFlo Independen VM
Repositor
Layered 23/33
n Arch Architecture w t y

Independent component architecture: an example, film and


picture library

Client 1 Client 2 Client 3 Client 4

Wide-bandwidth network

Catalogue Video Picture Hypertext


server server server server

Catalogue Film clip Digitiz ed Hypertext


files photographs web

Software Engineering by Sommerville, 2004


Introductio Deployment SW DataFlo Independen VM
Repositor
Layered 24/33
n Arch Architecture w t y

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
Introductio Deployment SW DataFlo Independen Repositor 25/33
VM Layered
n Arch Architecture w t y

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.
Introductio Deployment SW DataFlo Independen
VM
Repositor Layered 26/33
n Arch Architecture w t y

4- Repository architecture
14.3.4.4
• Primarily built around large data collection
App 1
database App 3
App 2 Applications mostly storage,retrievals, and querying.

• 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
Introductio Deployment SW DataFlo Independen
VM
Repositor Layere 27/33
n Arch Architecture w t y d

5- Layered architecture 14.3.4.5


• 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.
Introductio Deployment SW DataFlo Independen
VM
Repositor Layere 28/33
n Arch Architecture w t y d

Layered Architecture

3D engine layer

«uses»
Role-playing game layer

Characters RolePlayingGame .... Layout

«uses»
Application layer

Encounter Encounter
.... Encounter Game
Characters Environment
Introductio Deployment SW DataFlo Independen
VM
Repositor Layere 29/33
n Arch Architecture w t y d
Layered Architecture Example Using
Requirement: Print monthly statements Aggregation

Architecture: Vendor-supplied Layer


“uses” Accounts Layer Ajax bank common library Layer
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
Introductio Deployment SW DataFlo Independen Repositor 30/33
VM Layered
n Arch Architecture w t y

Coad-Yourdon Use of Packages

Example
Problem domain package
Java.applet
Interface package
Java.awt

Data management package Java.lang

Task management package

Figure 14.25: Coad-Yourdon Use of Packages


Introductio Deployment SW DataFlo Independen Repositor 31/33
VM Layered
n Arch Architecture w t y

Other architectures
• Control models: concerned with the control flow between
sub-systems.
– Centralised control: one sub-system Main
program
has overall responsibility for control
and starts and stops other sub-systems.
Routine 1 Routine 2 Routine 3
• Example: Call-return model

Routine 1.1 Routine 1.2 Routine 3.1 Routine 3.2

– Event-based control: each sub-system can respond to externally


generated events from other sub-systems or the system’s
environment
• Example: Broadcast model
Introductio Deployment SW DataFlo Independen Repositor 32/33
VM Layered
n Arch Architecture w t y

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

You might also like