lecture-05b-sw-architecture (3)
lecture-05b-sw-architecture (3)
Lecture 5
Software Architecture.
Reading:
Ian Summerville, Software Engineering (Chapter 6 – Architectural
Design)
Software Architecture
• Software Architecture: technical decisions made early
in a project that are expensive to change
– E.g your software is it client/server or layered?
– Is it distributed or works on one computer?
– How is one component planned to send data to another
(method call, messaging, …)?
Requirements
Code
3
Better answer
Requirements
Code
4
Software Architecture
“The architecture of a software system defines that
system in terms of computational components and
interactions among those components. …
5
Architecture Example
• Boxes are components and Arrows are Interactions
– Boxes within boxes indicate that the component has been
decomposed to sub-components
component
connector
6
Software Architecture
• Components define a unit of computations or data
store comprising the system and their behaviors
– A component is an implementation of a subsystem.
• E.g client and server components/subsystems
• E.g Network, transport, application components/subsystems
• E.g Game UI, Game Event handler, Game Engine components
– Has an interface specifying the services it provides
– A unit of reuse and replacement
– A unit of deployment
• Connectors define the interconnections between
components
– procedure call, event announcement, asynchronous
message sends, etc. through an interface
• Difference between connector and components is
7
What is Good Architecture?
• A good architecture satisfies functional requirements
– Components host functionality (functional requirements)
8
What is Good Architecture?
• A good architecture satisfies functional requirements
– Components host functionality (functional requirements)
11
Drawing Architecture
Symbols
13
UML (Unified modeling
language)
• A standardized way to describe (draw) architecture
– Also implementation details such as sub classing,
dependences, and much more
Web application
• UML represents components as:
14
15
Component Diagram
• Architectures can be expressed as component
diagrams in UML
WebBrowser WebServer
HTTP
interface
16
Library system
17
Deployment Diagram
Deployment diagrams have several valuable
applications. You can use them to
• Show which software elements are deployed by which
hardware elements.
• Illustrate the runtime processing for hardware.
• Provide a view of the hardware system’s topology.
18
Deployment Diagram
• Deployment diagrams also express another view of the
Architecture. nodes
PersonalComp DeptServer
WebBrowser WebServer
components
19
Architectural Styles
20
Architectural Styles
• Layered
• Repository
• Client/Server
21
Layered Architecture
• Layers up will use services from layer beneath them
• the system functionality is organized into separate layers
22
Advantages
• Allows replacement of entire layers so long as the interface is
maintained.
• Redundant facilities (e.g., authentication) can be provided in each
layer to increase the dependability of the system.
Disadvantages
• In practice, providing a clean separation between layers is often
difficult and a high-level
• Performance can be a problem because of multiple levels of
interpretation of a service request as it is processed at each layer.
23
Library system example
24
Architectural Style:
Repository
Input Transactions
components
Repository
Repository
This is sometimes
called a "glue" layer
Data Store
Firefox Apache
client server
The control flows in the client and the server are independent.
communication between client and server follows a protocol.
27
Advantages
• servers can be distributed across a network.
• General functionality (e.g., a printing service) can be available to all
clients and does not need to be implemented by all services.
Disadvantages
• Each service is a single point of failure so susceptible to denial of
service attacks or server failure.
• Performance may be unpredictable because it depends on the network
as well as the system.
• May be management problems if servers are owned by different
organizations.
28
Architectural Style: Pipe
29
Advantages
• Easy to understand and supports transformation.
• Can be implemented as either a sequential or concurrent system.
Disadvantages
• The format for data transfer has to be agreed upon between
communicating transformations.
• Each transformation must parse its input and un parse its output to the
agreed form. This increases system overhead and may mean that it is
impossible to reuse
30
Three Tier Architecture
• run-time organization
Web example: Serving dynamic pages
Each of the tiers can be replaced by other components that
implement the same interfaces
Very very common (also called MVC – Model (db), View
(presentation), Controller(application tier))
This is the architecture you will probably use
31
Architectural Style:
Three Tier Architecture
These components might be
located on a single node
32
UML Notation: Package
JavaScript
JavaScript
JavaScript
HTTP
34
Other Architectures
• Read Sommervillie, Software Engineering, Chapter 6
• Read more on UML diagrams we learned so far(component,
deployment and package).
• Read more on three tier architecture.
• Reminder for SRS Submission and presentation
35