Architectural Design in Software Engineering Se10 10953
Transcript of Architectural Design in Software Engineering Se10 10953
8/10/2019 Architectural Design in Software Engineering Se10 10953
http://slidepdf.com/reader/full/architectural-design-in-software-engineering-se10-10953 1/44
© Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10 Slide 1
Architectural Design
Establishing the overall
structure of a software system
8/10/2019 Architectural Design in Software Engineering Se10 10953
http://slidepdf.com/reader/full/architectural-design-in-software-engineering-se10-10953 2/44
© Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10 Slide 2
Objectives
To introduce architectural design and to discuss itsimportanceTo explain why multiple models are required todocument a software architectureTo describe types of architectural model that maybe used
To discuss how domain-specific reference modelsmay be used as a basis for product-lines and tocompare software architectures
8/10/2019 Architectural Design in Software Engineering Se10 10953
http://slidepdf.com/reader/full/architectural-design-in-software-engineering-se10-10953 3/44
© Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10 Slide 3
Topics covered
System structuringControl modelsModular decompositionDomain-specific architectures
8/10/2019 Architectural Design in Software Engineering Se10 10953
http://slidepdf.com/reader/full/architectural-design-in-software-engineering-se10-10953 4/44
© Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10 Slide 4
Software architecture
The design process for identifying the sub-systems making up a system and the frameworkfor sub-system control and communication is
architectural designThe output of this design process is a descriptionof the software architecture
8/10/2019 Architectural Design in Software Engineering Se10 10953
http://slidepdf.com/reader/full/architectural-design-in-software-engineering-se10-10953 5/44
© Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10 Slide 5
Architectural design
An early stage of the system design processRepresents the link between specification anddesign processesOften carried out in parallel with somespecification activitiesIt involves identifying major system components
and their communications
8/10/2019 Architectural Design in Software Engineering Se10 10953
http://slidepdf.com/reader/full/architectural-design-in-software-engineering-se10-10953 6/44
© Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10 Slide 6
Advantages of explicit architecture
Stakeholder communication• Architecture may be used as a focus of discussion by system
stakeholders
System analysis• Means that analysis of whether the system can meet its non-
functional requirements is possible
Large-scale reuse
• The architecture may be reusable across a range of systems
8/10/2019 Architectural Design in Software Engineering Se10 10953
http://slidepdf.com/reader/full/architectural-design-in-software-engineering-se10-10953 7/44© Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10 Slide 7
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
8/10/2019 Architectural Design in Software Engineering Se10 10953
http://slidepdf.com/reader/full/architectural-design-in-software-engineering-se10-10953 8/44© Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10 Slide 8
Sub-systems and modules
A sub-system is a system in its own right whoseoperation is independent of the services providedby other sub-systems.
A module is a system component that providesservices to other components but would notnormally be considered as a separate system
8/10/2019 Architectural Design in Software Engineering Se10 10953
http://slidepdf.com/reader/full/architectural-design-in-software-engineering-se10-10953 9/44© Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10 Slide 9
Architectural models
Different architectural models may be producedduring the design processEach model presents different perspectives on thearchitecture
8/10/2019 Architectural Design in Software Engineering Se10 10953
http://slidepdf.com/reader/full/architectural-design-in-software-engineering-se10-10953 10/44© Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10 Slide 10
Architectural models
Static structural model that shows the majorsystem componentsDynamic process model that shows the processstructure of the systemInterface model that defines sub-systeminterfaces
Relationships model such as a data-flow model
8/10/2019 Architectural Design in Software Engineering Se10 10953
http://slidepdf.com/reader/full/architectural-design-in-software-engineering-se10-10953 11/44© Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10 Slide 11
Architectural styles
The architectural model of a system may conformto a generic architectural model or styleAn awareness of these styles can simplify theproblem of defining system architecturesHowever, most large systems are heterogeneousand do not follow a single architectural style
8/10/2019 Architectural Design in Software Engineering Se10 10953
http://slidepdf.com/reader/full/architectural-design-in-software-engineering-se10-10953 12/44© Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10 Slide 12
Architecture attributes
Performance• Localise operations to minimise sub-system communication
Security
• Use a layered architecture with critical assets in inner layersSafety• Isolate safety-critical components
Availability
• Include redundant components in the architectureMaintainability• Use fine-grain, self-contained components
8/10/2019 Architectural Design in Software Engineering Se10 10953
http://slidepdf.com/reader/full/architectural-design-in-software-engineering-se10-10953 13/44© Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10 Slide 13
System structuring
Concerned with decomposing the system intointeracting sub-systemsThe architectural design is normally expressed asa block diagram presenting an overview of thesystem structureMore specific models showing how sub-systems
share data, are distributed and interface with eachother may also be developed
8/10/2019 Architectural Design in Software Engineering Se10 10953
http://slidepdf.com/reader/full/architectural-design-in-software-engineering-se10-10953 14/44
© Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10 Slide 14
Packing robot control systemVisionsystem
Objectidentification
system
Armcontroller
Gripper controller
Packagingselectionsystem
Packingsystem
Conveyor controller
8/10/2019 Architectural Design in Software Engineering Se10 10953
http://slidepdf.com/reader/full/architectural-design-in-software-engineering-se10-10953 15/44
© Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10 Slide 15
The repository model
Sub-systems must exchange data. This may bedone 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 dataexplicitly to other sub-systems
When large amounts of data are to be shared, the
repository model of sharing is most commonlyused
8/10/2019 Architectural Design in Software Engineering Se10 10953
http://slidepdf.com/reader/full/architectural-design-in-software-engineering-se10-10953 16/44
© Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10 Slide 16
CASE toolset architecture
Projectrepository
Designtranslator
Programeditor
Designeditor
Codegenerator
Designanalyser
Reportgenerator
8/10/2019 Architectural Design in Software Engineering Se10 10953
http://slidepdf.com/reader/full/architectural-design-in-software-engineering-se10-10953 17/44
© Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10 Slide 17
Repository model characteristics
Advantages• Efficient way to share large amounts of data• Sub-systems need not be concerned with how data is produced
Centralised management e.g. backup, security, etc.• Sharing model is published as the repository schema
Disadvantages• Sub-systems must agree on a repository data model. Inevitably a
compromise
• Data evolution is difficult and expensive• No scope for specific management policies• Difficult to distribute efficiently
8/10/2019 Architectural Design in Software Engineering Se10 10953
http://slidepdf.com/reader/full/architectural-design-in-software-engineering-se10-10953 18/44
© Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10 Slide 18
Client-server architecture
Distributed system model which shows how dataand processing is distributed across a range ofcomponents
Set of stand-alone servers which provide specificservices such as printing, data management, etc.Set of clients which call on these services
Network which allows clients to access servers
8/10/2019 Architectural Design in Software Engineering Se10 10953
http://slidepdf.com/reader/full/architectural-design-in-software-engineering-se10-10953 19/44
8/10/2019 Architectural Design in Software Engineering Se10 10953
http://slidepdf.com/reader/full/architectural-design-in-software-engineering-se10-10953 20/44
© Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10 Slide 20
Client-server characteristics
Advantages• Distribution of data is straightforward• 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
8/10/2019 Architectural Design in Software Engineering Se10 10953
http://slidepdf.com/reader/full/architectural-design-in-software-engineering-se10-10953 21/44
© Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10 Slide 21
Abstract machine model
Used to model the interfacing of sub-systemsOrganises the system into a set of layers (or abstractmachines) each of which provide a set of services
Supports the incremental development of sub-systems in different layers. When a layer interfacechanges, only the adjacent layer is affectedHowever, often difficult to structure systems in thisway
8/10/2019 Architectural Design in Software Engineering Se10 10953
http://slidepdf.com/reader/full/architectural-design-in-software-engineering-se10-10953 22/44
© Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10 Slide 22
Version management system
Operatingsystem
Database system
Object management
Version management
8/10/2019 Architectural Design in Software Engineering Se10 10953
http://slidepdf.com/reader/full/architectural-design-in-software-engineering-se10-10953 23/44
© Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10 Slide 23
Control models
Are concerned with the control flow betweensub-systems. Distinct from the systemdecomposition model
Centralised 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 the system’s environment
8/10/2019 Architectural Design in Software Engineering Se10 10953
http://slidepdf.com/reader/full/architectural-design-in-software-engineering-se10-10953 24/44
© Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10 Slide 24
Centralised control
A control sub-system takes responsibility formanaging the execution of other sub-systemsCall-return model• Top-down subroutine model where control starts at the top of a
subroutine hierarchy and moves downwards. Applicable tosequential systems
Manager model• Applicable to concurrent systems. One system component controls
the stopping, starting and coordination of other system processes.Can be implemented in sequential systems as a case statement
8/10/2019 Architectural Design in Software Engineering Se10 10953
http://slidepdf.com/reader/full/architectural-design-in-software-engineering-se10-10953 25/44
© Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10 Slide 25
Call-return model
Routine %+&Routine %+% Routine '+&Routine '+%
Routine & Routine 'Routine %
,ain program
8/10/2019 Architectural Design in Software Engineering Se10 10953
http://slidepdf.com/reader/full/architectural-design-in-software-engineering-se10-10953 26/44
© Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10 Slide 26
Real-time system control
-ystemcontroller
.ser interface
Fault!andler
Computation processes
Actuator processes
-ensor processes
8/10/2019 Architectural Design in Software Engineering Se10 10953
http://slidepdf.com/reader/full/architectural-design-in-software-engineering-se10-10953 27/44
© Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10 Slide 27
Event-driven systemsDriven by externally generated events where thetiming of the event is outwith the control of the sub-systems which process the event
Two principal event-driven models• Broadcast models. An event is broadcast to all sub-systems. Any sub-
system which can handle the event may do so• Interrupt-driven models. Used in real-time systems where interrupts
are detected by an interrupt handler and passed to some other
component for processingOther event driven models include spreadsheets andproduction systems
8/10/2019 Architectural Design in Software Engineering Se10 10953
http://slidepdf.com/reader/full/architectural-design-in-software-engineering-se10-10953 28/44
© Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10 Slide 28
Broadcast modelEffective in integrating sub-systems on differentcomputers in a network Sub-systems register an interest in specific events. When
these occur, control is transferred to the sub-systemwhich can handle the eventControl policy is not embedded in the event and messagehandler. Sub-systems decide on events of interest to
themHowever, sub-systems don’t know if or when an eventwill be handled
8/10/2019 Architectural Design in Software Engineering Se10 10953
http://slidepdf.com/reader/full/architectural-design-in-software-engineering-se10-10953 29/44
© Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10 Slide 29
Selective broadcasting
-ub*system%
/vent and messa ge !andler
-ub*system&
-ub*system'
-ub*system(
8/10/2019 Architectural Design in Software Engineering Se10 10953
http://slidepdf.com/reader/full/architectural-design-in-software-engineering-se10-10953 30/44
© Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10 Slide 30
Interrupt-driven systems
Used in real-time systems where fast response toan event is essentialThere are known interrupt types with a handler
defined for each typeEach type is associated with a memory locationand a hardware switch causes transfer to itshandlerAllows fast response but complex to program anddifficult to validate
8/10/2019 Architectural Design in Software Engineering Se10 10953
http://slidepdf.com/reader/full/architectural-design-in-software-engineering-se10-10953 31/44
© Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10 Slide 31
Interrupt-driven control
"andler %
"andler &
"andler '
"andler (
Process%
Process&
Process'
Process(
0nterrupts
0nterruptvector
8/10/2019 Architectural Design in Software Engineering Se10 10953
http://slidepdf.com/reader/full/architectural-design-in-software-engineering-se10-10953 32/44
© Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10 Slide 32
Modular decomposition
Another structural level where sub-systems aredecomposed into modulesTwo modular decomposition models covered• An object model where the system is decomposed into
interacting objects• A data-flow model where the system is decomposed into
functional modules which transform inputs to outputs. Alsoknown as the pipeline model
If possible, decisions about concurrency shouldbe delayed until modules are implemented
8/10/2019 Architectural Design in Software Engineering Se10 10953
http://slidepdf.com/reader/full/architectural-design-in-software-engineering-se10-10953 33/44
© Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10 Slide 33
Object models
Structure the system into a set of loosely coupledobjects with well-defined interfacesObject-oriented decomposition is concerned withidentifying object classes, their attributes andoperationsWhen implemented, objects are created from
these classes and some control model used tocoordinate object operations
8/10/2019 Architectural Design in Software Engineering Se10 10953
http://slidepdf.com/reader/full/architectural-design-in-software-engineering-se10-10953 34/44
© Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10 Slide 34
Invoice processing system
issue 12sendReminder 12acceptPayment 12sendReceipt 12
invoice3dateamountcustomer
0nvoice
invoice3dateamountcustomer3
Receipt
invoice3
dateamountcustomer3
Payment
customer3nameaddresscredit period
Customer
8/10/2019 Architectural Design in Software Engineering Se10 10953
http://slidepdf.com/reader/full/architectural-design-in-software-engineering-se10-10953 35/44
© Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10 Slide 35
Data-flow models
Functional transformations process their inputs toproduce outputsMay be referred to as a pipe and filter model (as in
UNIX shell)Variants of this approach are very common. Whentransformations are sequential, this is a batchsequential model which is extensively used in dataprocessing systemsNot really suitable for interactive systems
8/10/2019 Architectural Design in Software Engineering Se10 10953
http://slidepdf.com/reader/full/architectural-design-in-software-engineering-se10-10953 36/44
© Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10 Slide 36
Invoice processing system
Read issuedinvoices 0dentify payments
0ssuereceipts
Find payments
due
Receipts
0ssue paymentreminder
Reminders
0nvoices Payments
8/10/2019 Architectural Design in Software Engineering Se10 10953
http://slidepdf.com/reader/full/architectural-design-in-software-engineering-se10-10953 37/44
© Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10 Slide 37
Domain-specific architectures
Architectural models which are specific to someapplication domainTwo types of domain-specific model
• Generic models which are abstractions from a number of realsystems and which encapsulate the principal characteristics of thesesystems
• Reference models which are more abstract, idealised model. Providea means of information about that class of system and of comparingdifferent architectures
Generic models are usually bottom-up models;Reference models are top-down models
8/10/2019 Architectural Design in Software Engineering Se10 10953
http://slidepdf.com/reader/full/architectural-design-in-software-engineering-se10-10953 38/44
© Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10 Slide 38
Generic modelsCompiler model is a well-known example althoughother models exist in more specialised applicationdomains• Lexical analyser• Symbol table• Syntax analyser• Syntax tree• Semantic analyser• Code generator
Generic compiler model may be organised according todifferent architectural models
8/10/2019 Architectural Design in Software Engineering Se10 10953
http://slidepdf.com/reader/full/architectural-design-in-software-engineering-se10-10953 39/44
© Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10 Slide 39
Compiler model
4e#icalanalysis
-yntacticanalysis
-emanticanalysis
Codegeneration
-ymboltable
8/10/2019 Architectural Design in Software Engineering Se10 10953
http://slidepdf.com/reader/full/architectural-design-in-software-engineering-se10-10953 40/44
© Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10 Slide 40
Language processing system
-ynta#analyser
4e#icalanalyser
-emanticanalyser
Abstractsynta# tree
Grammar definition
-ymboltable
Outputdefinition
Pretty* printer
/ditor
Optimi er
Codegenerator
Repository
8/10/2019 Architectural Design in Software Engineering Se10 10953
http://slidepdf.com/reader/full/architectural-design-in-software-engineering-se10-10953 41/44
© Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10 Slide 41
Reference architectures
Reference models are derived from a study of theapplication domain rather than from existingsystems
May be used as a basis for system implementationor to compare different systems. It acts as astandard against which systems can be evaluatedOSI model is a layered model for communicationsystems
8/10/2019 Architectural Design in Software Engineering Se10 10953
http://slidepdf.com/reader/full/architectural-design-in-software-engineering-se10-10953 42/44
© Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10 Slide 42
OSI reference modelApplication
Presentation
-ession
5ransport
6et$ork
Data link
P!ysical
7
8
9
(
'
&
%
Communica tions medium
6et$ork
Data link
P!ysical
Application
Presentation
-ession
5ransport
6et$ork
Data link P!ysical
Application
8/10/2019 Architectural Design in Software Engineering Se10 10953
http://slidepdf.com/reader/full/architectural-design-in-software-engineering-se10-10953 43/44
© Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10 Slide 43
Key pointsThe software architect is responsible for deriving astructural system model, a control model and a sub-system decomposition model
Large systems rarely conform to a single architecturalmodelSystem decomposition models include repositorymodels, client-server models and abstract machinemodelsControl models include centralised control and event-driven models
8/10/2019 Architectural Design in Software Engineering Se10 10953
http://slidepdf.com/reader/full/architectural-design-in-software-engineering-se10-10953 44/44
Key points
Modular decomposition models include data-flowand object modelsDomain specific architectural models areabstractions over an application domain. Theymay be constructed by abstracting from existingsystems or may be idealised reference models