Вы находитесь на странице: 1из 65

Ian Sommerville 2000 Software Engineering.

Chapter 11 Slide 1
Chapter 11
Architectural Design
Ian Sommerville 2000 Software Engineering. Chapter 11 Slide 2
Part 3 Design
G Chap 11, Architectural design
G Chap 12, Distributed systems architectures
G Chap 13, Application Architectures
G Chap 14, Object-oriented design
G Chap 15, Real-time software design
G Chap 16, User interface design
----------
G (+ Chap 31, Service-oriented software engineering)
G (+ Chap 32, Aspect-oriented software development)
Ian Sommerville 2000 Software Engineering. Chapter 11 Slide 3
Architectural Design
G Establishing the overall structure of a
software system
Ian Sommerville 2000 Software Engineering. Chapter 11 Slide 4
Objectives
G To introduce architectural design and to
discuss its importance
G To explain why multiple models are
required to document an architecture
G To describe types of architectural models
that may be used
G To discuss use of domain-specific
architectural reference models
Ian Sommerville 2000 Software Engineering. Chapter 11 Slide 5
Topics covered
G Architectural design context
G System structuring models
G System control models
G Modular decomposition models
G Domain-specific architectures
Ian Sommerville 2000 Software Engineering. Chapter 11 Slide 6
Topics covered
G Architectural design context
G System structuring models
G System control models
G Modular decomposition models
G Domain-specific architectures
Ian Sommerville 2000 Software Engineering. Chapter 11 Slide 7
What is architectural design?
G The process of identifying the sub-
systems making up a system and a
framework for sub-system communication
and control.
G A boot-strapping process undertaken in
parallel with the abstract specification of
sub-systems.
G The output of this process is the software
architecture.
Ian Sommerville 2000 Software Engineering. Chapter 11 Slide 8
What is architectural design?
G The process of identifying the sub-
systems making up a system and a
framework for sub-system communication
and control.
G A boot-strapping process undertaken in
parallel with the abstract specification of
sub-systems.
G The output of this process is the software
architecture.
Ian Sommerville 2000 Software Engineering. Chapter 11 Slide 9
What is architectural design?
G The process of identifying the sub-
systems making up a system and a
framework for sub-system communication
and control.
G A boot-strapping process undertaken in
parallel with the abstract specification of
sub-systems.
G The output of this process is the software
architecture.
Ian Sommerville 2000 Software Engineering. Chapter 11 Slide 10
The software design process
Architectur al
design
Abstract
specification
Interface
design
Component
design
Data
structur e
design
Algorithm
design
System
architectur e
Software
specification
Interface
specification
Component
specification
Data
structur e
specification
Algorithm
specification
Requirements
specification
Design acti vities
Design pr oducts
Ian Sommerville 2000 Software Engineering. Chapter 11 Slide 11
Advantages of explicit architecture
design and documentation (Bass)
G Stakeholder communication the archi-
tecture may be used as a focus of discussion by
system stakeholders.
G System analysis the feasibility of meeting
critical non-functional requirements (e.g., perfor-
mance, reliability, maintainability) can be studied
early-on.
G Large-scale reuse the architecture may be
reusable across a range of systems with similar
requirements.
(Requirements can be organized by sub-system.)
Ian Sommerville 2000 Software Engineering. Chapter 11 Slide 12
Architectural design process
G System structuring the system is decom-
posed into major sub-systems and commun-
ication (e.g., data sharing) mechanisms are
identified.
G Control modelling a model of the control
relationships between the sub-systems is
established.
G Modular decomposition the identified
sub-systems are decomposed into lower-level
modules (components, objects, etc.)
Ian Sommerville 2000 Software Engineering. Chapter 11 Slide 13
Terminology issues
G Modular decomposition is sometimes
called high-level (system) design.
G A sub-system is usually a system in its
own right, and is sometimes called a
Product. (or perhaps a stand-alone increment)
G A module is a lower-level element that
would not normally be considered a
separate system; modules are sometimes
called Components or Objects.
Ian Sommerville 2000 Software Engineering. Chapter 11 Slide 14
Traditional (and Sommervilles)
terminology
System (System)
Product (Sub-System)
Component (Module)
Module (Unit) (Algorithm)
Ian Sommerville 2000 Software Engineering. Chapter 11 Slide 15
Graphical models
G Different graphical models may be used
to represent an architectural design.
G Each presents a different perspective
(viewpoint) on the architecture.
Ian Sommerville 2000 Software Engineering. Chapter 11 Slide 16
Graphical model types
G Static structural models show the major
system components. (e.g., block diagrams)
G Dynamic process models show the
process structure of the system at run-
time. (e.g., UML Sequence Models)
G Interface models define the sub-system
services offered through public interfaces.
G Relationship models show relationships
(e.g., dataflow) among sub-systems for
some attribute.
Ian Sommerville 2000 Software Engineering. Chapter 11 Slide 17
Architectural styles
G The architecture of a system may conform
to a single generic model or style, although
most do not.
G An awareness of these styles and how
they can affect system attributes can
simplify the problem of choosing an
appropriate architecture
Ian Sommerville 2000 Software Engineering. Chapter 11 Slide 18
System attributes and (associated)
architectural styles / structures
G Performance localize operations by
using fewer, large-grain components to
minimize sub-system communication.
(reflected in repository model)
G Security use a layered architecture
with critical assets in inner layers.
(reflected in abstract machine model)
Ian Sommerville 2000 Software Engineering. Chapter 11 Slide 19
System attributes and (associated)
architectural styles / structures
G Safety isolate safety-critical compo-
nents in one or just a few sub-systems.
G Availability include redundant com-
ponents in the architecture.
G Maintainability use (more) fine-grain,
self-contained components. (reflected in
objected-oriented model)
Ian Sommerville 2000 Software Engineering. Chapter 11 Slide 20
Topics covered
G Architectural design context
G System structuring models
G System control models
G Modular decomposition models
G Domain-specific architectures
Ian Sommerville 2000 Software Engineering. Chapter 11 Slide 21
System structuring
G Concerned with decomposing the system
into interacting sub-systems.
G The basic system structure is often
expressed as a block diagram.
G More specific models showing how sub-
systems share data, are distributed, and
interface with each other may also be
developed. (Examples follow.)
Ian Sommerville 2000 Software Engineering. Chapter 11 Slide 22
Example of a simple block diagram:
Packing robot control system
V i si on
s ys te m
Ob j ec t
i de nt if i c a t io n
s ys te m
Ar m
c on tr o ll er
Gr i pp e r
c on tr o ll er
P a c ka g in g
s el e c ti on
s ys te m
P a c ki ng
s ys te m
C o nve yo r
c on tr o ll er
data / control
Ian Sommerville 2000 Software Engineering. Chapter 11 Slide 23
The repository model
G Sub-systems must exchange info. 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. (data is global)
Each sub-system maintains its own database
and passes data explicitly to other sub-
systems.
G When large amounts of data are used, the
repository model of sharing is commonly
used.
Ian Sommerville 2000 Software Engineering. Chapter 11 Slide 24
CASE toolset architecture
Project
repository
Design
translator
Program
editor
Design
editor
Code
generator
Design
analyser
Report
generator
Ian Sommerville 2000 Software Engineering. Chapter 11 Slide 25
Repository model advantages
G Simple and efficient way to share large amounts
of data locally. (versus a number of distributed machines)
G Sub-systems which use data need not be
concerned with how that data is produced, and
vice-versa.
G Management activities such as backup, access
control, and recovery are centralized.
G Sharing model is published as the repository
schema. Integration of compatible tools is
relatively easy.
Ian Sommerville 2000 Software Engineering. Chapter 11 Slide 26
Repository model disadvantages
G Sub-systems must agree on a single repository
data model -- inevitably a compromise.
G Data model evolution is difficult and expensive.
G No provision for sub-system-specific data
management requirements related to backup,
access control, and recovery.
G May be difficult to distribute efficiently over a
number of machines due to problems with data
redundancy and inconsistency.
Ian Sommerville 2000 Software Engineering. Chapter 11 Slide 27
The client-server model
G Distributed system model which shows
how data and processing are distributed
across a range of processors. (machines)
G Major components:
A set of stand-alone servers which provide
specific services such as printing, file
management, etc.
A set of clients which call on these services
A network which allows clients to access
these services
Ian Sommerville 2000 Software Engineering. Chapter 11 Slide 28
Example of a simple client-server based
system: Film and picture library
Catalogue
server
Catalogue
Video
server
Film clip
files
Picture
server
Digitized
photographs
Hypertext
server
Hypertext
web
Client 1 Client 2 Client 3 Client 4
Wide-bandwidth network
Ian Sommerville 2000 Software Engineering. Chapter 11 Slide 29
Client-server model advantages
G Supports distributed computing. (Focus of Chap 12)
G Underlying network makes distribution of data
straightforward.
G No shared data model so servers may organize
data to optimize their performance.
G Distinction between servers and clients may
allow use of cheaper hardware.
G Relatively easy to expand or upgrade system.
Ian Sommerville 2000 Software Engineering. Chapter 11 Slide 30
Client-server model disadvantages
G Relatively complex architecture problem
determination can be difficult. (!)
G No shared data model so data integration may
be problematic. (must be ad hoc)
G Redundant data management activities in each
server, possibly. (Consider film and picture library.)
G No central register of names and services, so it
may be hard to find out what servers and
services are available.
Ian Sommerville 2000 Software Engineering. Chapter 11 Slide 31
The abstract machine model
G Organizes a system into a series of layers.
G Each layer defines an abstract machine and
provides a set of services used to implement the
next level of abstract machine.
G When a layer interface changes, only the
adjacent layer is affected.
G However, it is often difficult to structure systems
in this way. (Why?)
Ian Sommerville 2000 Software Engineering. Chapter 11 Slide 32
Example of a simple abstract machine
based version management system
Op erat in g
s ys tem
Dat ab as e s ys tem
Ob ject managemen t
Versi on man ag emen t
Ian Sommerville 2000 Software Engineering. Chapter 11 Slide 33
The abstract machine model
G Organizes a system into a series of layers.
G Each layer defines an abstract machine and
provides a set of services used to implement the
next level of abstract machine.
G When a layer interface changes, only the
adjacent layer is affected.
G However, it is often difficult to structure systems
in this way. (Why?)
Ian Sommerville 2000 Software Engineering. Chapter 11 Slide 34
Topics covered
G Architectural design context
G System structuring models
G System control models
G Modular decomposition models
G Domain-specific architectures
Ian Sommerville 2000 Software Engineering. Chapter 11 Slide 35
Control models
G Concerned with the control flow between
sub-systems. Distinct from the system
structure model.
G Two general approaches:
Centralized control one sub-system has
overall responsibility for control and starts and
stops other sub-systems.
Event-based control each sub-system can
respond to externally generated events from other
sub-systems, or from the systems environment.
Ian Sommerville 2000 Software Engineering. Chapter 11 Slide 36
Centralized control models
1. Call-return model top-down subroutine
model where control starts at the top of a
subroutine hierarchy and moves downwards.
Applicable to sequential systems only.
2. Manager model applicable to concurrent
systems. One system component controls the
stopping, starting and coordination of other
system processes. Also applicable to sequential
systems where it is usually implemented as a
case statement within a management routine.
Ian Sommerville 2000 Software Engineering. Chapter 11 Slide 37
Call-return model
Routine 1.2 Routine 1.1 Routine 3.2 Routine 3.1
Routine 2 Routine 3 Routine 1
Main
program
call
return
Ian Sommerville 2000 Software Engineering. Chapter 11 Slide 38
Centralized control models
1. Call-return model top-down subroutine
model where control starts at the top of a
subroutine hierarchy and moves downwards.
Applicable to sequential systems only.
2. Manager model applicable to concurrent
systems. One system component controls the
stopping, starting and coordination of other
system processes. Also applicable to sequential
systems where it is usually implemented as a
case statement within a management routine.
Ian Sommerville 2000 Software Engineering. Chapter 11 Slide 39
Manager model: real-time
system control
System
contr oller
User
interface
Fault
handler
Computation
processes
Actuator
processes
Sensor
processes
Ian Sommerville 2000 Software Engineering. Chapter 11 Slide 40
Control models
G Concerned with the control flow between
sub-systems. Distinct from the system
structure model.
G Two general approaches:
Centralized control one sub-system has
overall responsibility for control and starts and
stops other sub-systems.
Event-based control each sub-system can
respond to externally generated events from other
sub-systems, or from the systems environment.
Ian Sommerville 2000 Software Engineering. Chapter 11 Slide 41
Principal Event-based control models
(several variations exist)
1. Broadcast model an event is broadcast to
all (or possibly just some) sub-systems; any sub-
system which can handle the event may do so.
2. Interrupt-driven model used in real-time
systems where interrupts are detected by an
interrupt handler and passed to some other
component for processing.
(Other event-based models include compound documents and
production systems.)
Ian Sommerville 2000 Software Engineering. Chapter 11 Slide 42
Broadcast model
G Effective in integrating sub-systems executing
on different computers in a network.
G Control policy is NOT embedded in the
message handler. (as in the Manager model)
G Sub-systems register an interest in specific
events and the event handler ensures that
these events are sent to them.
G Registration of interests supports selective
broadcasting.
(Contd)
Ian Sommerville 2000 Software Engineering. Chapter 11 Slide 43
Broadcast model (contd)
G Evolution is relatively easy since a new sub-system
can be integrated by registering its events with the
event handler.
G However, sub-systems dont know if or when an
event will be handled by some other sub-system.
Ian Sommerville 2000 Software Engineering. Chapter 11 Slide 44
Selective broadcasting
Sub-system
1
Event and message handler
Sub-system
2
Sub-system
3
Sub-system
4
Events broadcasted only to registered sub-systems
Ian Sommerville 2000 Software Engineering. Chapter 11 Slide 45
Interrupt-driven systems
G Used in real-time systems where fast
response to an event is essential.
G A handler is defined for each type of
interrupt.
G Each type is associated with a memory
location and a hardware switch causes
transfer to its handler fast!
G Allows fast response but is complex to
program and difficult to verify. (why?)
Ian Sommerville 2000 Software Engineering. Chapter 11 Slide 46
Interrupt-driven control
Handler
1
Handler
2
Handler
3
Handler
4
Process
1
Process
2
Process
3
Process
4
Interrupts
Interrupt
vector
Ian Sommerville 2000 Software Engineering. Chapter 11 Slide 47
Topics covered
G Architectural design context
G System structuring models
G System control models
G Modular decomposition models
G Domain-specific architectures
Ian Sommerville 2000 Software Engineering. Chapter 11 Slide 48
Modular decomposition (a.k.a.
high-level design) models
G Sub-systems are decomposed into lower-
level elements.
G Two models are considered:
An object model where the system is decom-
posed into interacting objects. (object-oriented
design)
A data-flow model where the system is
decomposed into functional modules which
transform inputs into outputs. (function-oriented
design)
Ian Sommerville 2000 Software Engineering. Chapter 11 Slide 49
Object models (o-o design)
G Structure the system into a set of loosely coupled
objects with well-defined interfaces.
G Object-oriented decomposition is concerned with
identifying object classes, their attributes and
operations.
G When implemented, objects are created from
these classes and some control model is used to
coordinate object operations.
Ian Sommerville 2000 Software Engineering. Chapter 11 Slide 50
Example of simple object model:
Invoice processing system
issue ()
sendReminder ()
acceptPayment ()
sendReceipt ()
invoice#
date
amount
customer
Invoice
invoice#
date
amount
customer#
Receipt
invoice#
date
amount
customer#
Payment
customer#
name
address
credit period
Customer
Ian Sommerville 2000 Software Engineering. Chapter 11 Slide 51
Data-flow models (functional
design)
G Functional transformations process inputs
to produce outputs.
G Sometimes referred to as a pipe and filter
model (after terminology used in UNIX).
In the UK?
(Contd)
Ian Sommerville 2000 Software Engineering. Chapter 11 Slide 52
Data-flow models (contd)
G Variants of this approach have a long
history in software design. (e.g., SA/SD, SADT, etc.)
G When transformations are sequential, this is
a batch sequential model which is
extensively used in data processing
systems.
G Not really suitable for interactive systems
(focus on input data streams vs. events)
Ian Sommerville 2000 Software Engineering. Chapter 11 Slide 53
Invoice processing system
Read issued
invoices
Identify
payments
Issue
receipts
Find
payments
due
Receipts
Issue
payment
reminder
Reminders
Invoices Payments
Continuous
input streams
Ian Sommerville 2000 Software Engineering. Chapter 11 Slide 54
Topics covered
G Architectural design context
G System structuring models
G System control models
G Modular decomposition models
G Domain-specific architectures
Ian Sommerville 2000 Software Engineering. Chapter 11 Slide 55
Domain-specific architectures
G Models which are specific to some application
domain
G Two types of domain-specific models:
1. Generic models encapsulate the traditional, time-
tested characteristics of real systems.
2. Reference models are more abstract and describe a
larger class of systems. They provide a means of
comparing different systems in a domain.
G Generic models are usually bottom-up models;
Reference models are top-down models.
Ian Sommerville 2000 Software Engineering. Chapter 11 Slide 56
Generic models
G The compiler model is a well-known example.
G Based on the thousands written, it is now
generally agreed that the standard components
of a compiler are:
Lexical analyser
Symbol table
Syntax analyser
Syntax tree
Semantic analyser
Code generator
Ian Sommerville 2000 Software Engineering. Chapter 11 Slide 57
Compiler model
Lexical
analysis
Syntactic
analysis
Semantic
analysis
Code
generation
Symbol
table
Sequential function model
(batch processing oriented)
Ian Sommerville 2000 Software Engineering. Chapter 11 Slide 58
Synt ax
anal yser
Lexical
anal yser
Semant ic
anal yser
Ab stract
s yntax tree
Grammar
defi ni ti on
Sy mbol
t abl e
Out put
defi ni ti on
Prett y-
p ri nt er
Edit or
Opt imi zer
Code
generator
Reposi tory
Another example: language
processing system
Repository-based model
Ian Sommerville 2000 Software Engineering. Chapter 11 Slide 59
Domain-specific architectures
G Models which are specific to some application
domain
G Two types of domain-specific models:
1. Generic models encapsulate the traditional, time-
tested characteristics of real systems.
2. Reference models are more abstract and describe a
larger class of systems. They provide a means of
comparing different systems in a domain.
G Generic models are usually bottom-up models;
Reference models are top-down models.
Ian Sommerville 2000 Software Engineering. Chapter 11 Slide 60
Reference architectures
G Reference models are derived from a study
of the application domain rather than from
existing systems.
G May be used as a basis for system
implementation, or to compare different
systems. It acts as a standard against
which systems can be evaluated.
G The OSI (Open System Interconnection)
model is a layered model for communication
systems. (in particular, data processing / point-of-sale
applications)
Ian Sommerville 2000 Software Engineering. Chapter 11 Slide 61
A view of the OSI reference
model
Application
Presentation
Session
Transport
Network
Data link
Physical
7
6
5
4
3
2
1
Communications medium
Network
Data link
Physical
Application
Presentation
Session
Transport
Network
Data link
Physical
Application
Goal: to allow conformant
systems to communicate
with one another.
Ian Sommerville 2000 Software Engineering. Chapter 11 Slide 62
Another example: CASE
reference model (Fig. 11.12)
G Data repository services
Storage and management of data items.
G Data integration services
Managing groups of entities.
G Task management services
Definition and enaction (enactment) of process models.
G Messaging services
Tool-tool and tool-environment communication.
G User interface services
User interface development.
(Identifies 5 sets of services that a CASE
environment should provide.)
Ian Sommerville 2000 Software Engineering. Chapter 11 Slide 63
Key points
G The software architect is responsible for deriving
a structural system model, a control model, and
(possibly) a sub-system decomposition model.
G Large systems rarely conform to a single archi-
tectural model.
G System decomposition (structural) models
include the repository model, client-server model,
and abstract machine model.
G Control models include centralized control and
event-based models.
(Contd)
Ian Sommerville 2000 Software Engineering. Chapter 11 Slide 64
Key points (contd)
G Modular decomposition models include
data-flow and object models.
G Domain specific architectural models are
abstractions over an application domain.
G They may be constructed by abstracting
from existing systems (generic) or they
may be idealized (reference) models.
Ian Sommerville 2000 Software Engineering. Chapter 11 Slide 65
Chapter 11
Architectural Design

Вам также может понравиться