SE Unit 3
SE Unit 3
Design Engineering
and
4
Purpose of Design (continued)
• A designer must practice diversification and convergence
– The designer selects from design components, component
solutions, and knowledge available through catalogs, textbooks,
and experience
– The designer then chooses the elements from this collection that
meet the requirements defined by requirements engineering and
analysis modeling
– Convergence occurs as alternatives are considered and rejected
until one particular configuration of components is chosen
• Software design is an iterative process through which requirements
are translated into a blueprint for constructing the software
– Design begins at a high level of abstraction that can be directly
traced back to the data, functional, and behavioral requirements
– As design iteration occurs, subsequent refinement leads to design
representations at much lower levels of abstraction
5
From Analysis Model to
Design Model
• Each element of the analysis model provides information
that is necessary to create the four design models
Interface Design
Architectural Design
Data/Class Design
13
Quality Guidelines (continued)
5) A design should lead to components that exhibit
independent functional characteristics
6) A design should lead to interfaces that reduce the
complexity of connections between components and
with the external environment
7) A design should be derived using a repeatable method
that is driven by information obtained during software
requirements analysis
8) A design should be represented using a notation that
effectively communicates its meaning
19
Characteristics of a Well-Formed
Design Class
• Complete and sufficient
– Contains the complete encapsulation of all attributes and methods that exist for
the class
– Contains only those methods that are sufficient to achieve the intent of the class
• Primitiveness
– Each method of a class focuses on accomplishing one service for the class
• High cohesion
– The class has a small, focused set of responsibilities and single-mindedly applies
attributes and methods to implement those responsibilities
• Low coupling
– Collaboration of the class with other classes is kept to an acceptable minimum
– Each class should have limited knowledge of other classes in other subsystems
20
The Design Model
Component-level Design
Interface Design
Architectural Design
Data/Class Design
Dimensions of the Design Model
High
Analysis model
Abstraction Dimension
Design model
23
Introduction (continued)
• Design model elements are not always developed in a sequential
fashion
– Preliminary architectural design sets the stage
– It is followed by interface design and component-level design, which
often occur in parallel
• The design model has the following layered elements
– Data/class design
– Architectural design
Component-level Design
– Interface design
– Component-level design
Interface Design
• A fifth element that follows all of
the others is deployment-level design Architectural Design
Data/Class Design
24
Design Elements
• Data/class design
– Creates a model of data and objects that is represented at a high level of
abstraction
• Architectural design
– Depicts the overall layout of the software
• Interface design
– Tells how information flows into and out of the system and how it is
communicated among the components defined as part of the architecture
– Includes the user interface, external interfaces, and internal interfaces
• Component-level design elements
– Describes the internal detail of each software component by way of data
structure definitions, algorithms, and interface specifications
• Deployment-level design elements
– Indicates how software functionality and subsystems will be allocated within
the physical computing environment that will support the software
25
Pattern-based Software Design
• Mature engineering disciplines make use of thousands of design patterns for such
things as buildings, highways, electrical circuits, factories, weapon systems, vehicles,
and computers
• Design patterns also serve a purpose in software engineering
• Architectural patterns
– Define the overall structure of software
– Indicate the relationships among subsystems and software components
– Define the rules for specifying relationships among software elements
• Design patterns
– Address a specific element of the design such as an aggregation of components or solve
some design problem, relationships among components, or the mechanisms for effecting
inter-component communication
– Consist of creational, structural, and behavioral patterns
• Coding patterns
– Describe language-specific patterns that implement an algorithmic or data structure
element of a component, a specific interface protocol, or a mechanism for communication
among components
26
☺
Architectural Design
- Introduction
- Data design
- Software architectural styles
- Architectural design process
- Assessing alternative architectural designs
Introduction
Architectural design is a process for identifying
the sub-systems making up a system and the
framework for sub-system control and
communication. The output of this design process is
a description of the software architecture.
Architectural design is an early stage of the system
design process. It represents the link between
specification and design processes and is often
carried out in parallel with some specification
activities. It involves identifying major system
components and their communications.
Definitions
• The software architecture of a program or computing system is the structure
or structures of the system which comprise
– The software components
– The externally visible properties of those components
– The relationships among the components
• Software architectural design represents the structure of the data and
program components that are required to build a computer-based system
• An architectural design model is transferable
– It can be applied to the design of other systems
– It represents a set of abstractions that enable software engineers to describe
architecture in predictable ways
Architectural Design Process
• Basic Steps
– Creation of the data design
– Derivation of one or more representations of the architectural structure of the
system
– Analysis of alternative architectural styles to choose the one best suited to
customer requirements and quality attributes
– Elaboration of the architecture based on the selected architectural style
• A database designer creates the data architecture for a system to represent
the data components
• A system architect selects an appropriate architectural style derived during
system engineering and software requirements analysis
Emphasis on Software Components
(Source: Bass, Clements, and Kazman. Software Architecture in Practice. Addison-Wesley, 2003)
A Taxonomy of Architectural Styles
Independent Components
Implicit Explicit
Client/Server Peer-to-Peer
Invocation Invocation
Subroutine B
Subroutine A
Transport layer
Data layer
Class Z
Physical layer
Call-and-Return Style
• Has the goal of modifiability and scalability
• Has been the dominant architecture since the start of software
development
• Main program and subroutine style
– Decomposes a program hierarchically into small pieces (i.e., modules)
– Typically has a single thread of control that travels through various components
in the hierarchy
• Remote procedure call style
– Consists of main program and subroutine style of system that is decomposed
into parts that are resident on computers connected via a network
– Strives to increase performance by distributing the computations and taking
advantage of multiple processors
– Incurs a finite communication time between subroutine call and response
Shared Data
Program
Program Data
Instructions
Interpretation Program
Engine Internal State
Virtual Machine Style
• Has the goal of portability
• Software systems in this style simulate some functionality that is not
native to the hardware and/or software on which it is implemented
– Can simulate and test hardware platforms that have not yet been built
– Can simulate "disaster modes" as in flight simulators or safety-critical systems
that would be too complex, costly, or dangerous to test with the real system
• Examples include interpreters, rule-based systems, and command
language processors
• Interpreters
– Add flexibility through the ability to interrupt and query the program and
introduce modifications at runtime
– Incur a performance cost because of the additional computation involved in
execution
• Use this style when you have developed a program or some form of
computation but have no make of machine to directly run it on
Independent Component Style
Client A Client B
Server
Client C Client D
Peer W Peer X
Peer Y Peer Z
Independent Component Style
• Consists of a number of independent processes that communicate
through messages
• Has the goal of modifiability by decoupling various portions of the
computation
• Sends data between processes but the processes do not directly control
each other
• Event systems style
– Individual components announce data that they wish to share (publish) with
their environment
– The other components may register an interest in this class of data (subscribe)
– Makes use of a message component that manages communication among the
other components
– Components publish information by sending it to the message manager
– When the data appears, the subscriber is invoked and receives the data
– Decouples component implementation from knowing the names and
locations of other components
"A doctor can bury his mistakes, but an architect can only advise
his client to plant vines." Frank Lloyd Wright
1. Represent the System in Context
"Super"ordinate systems
Used by
I/F I/F I/F
Uses
Target system
Produces or
Produces or consumes Peers
Actors I/F I/F
consumes
Depends on
"Sub"ordinate systems
(Source: http://www.myss.com/ThreeArchs.asp)
Example Archetypes in Software
Architecture
• Node • Moment-Interval
• Detector/Sensor • Role
• Indicator • Description
• Controller • Party, Place, or Thing
• Manager
(Source: Pressman) (Source: Archetypes, Color, and the Domain Neutral Componen
Archetypes – their attributes
Archetypes – their methods
3. Refine the Architecture into Components
• Based on the archetypes, the architectural designer refines the software
architecture into components to illustrate the overall structure and
architectural style of the system
• These components are derived from various sources
– The application domain provides application components, which are the domain
classes in the analysis model that represent entities in the real world
– The infrastructure domain provides design components (i.e., design classes) that
enable application components but have no business connection
• Examples: memory management, communication, database, and task management
– The interfaces in the ACD imply one or more specialized components that
process the data that flow across the interface
• A UML class diagram can represent the classes of the refined architecture
and their relationships
4. Describe Instantiations of the System
• An actual instantiation of the architecture is developed by applying it to a
specific problem
• This demonstrates that the architectural structure, style and components
are appropriate
• A UML component diagram can be used to represent this instantiation
Assessing Alternative Architectural
Designs
Various Assessment Approaches
A. Ask a set of questions that provide the designer with an early
assessment of design quality and lay the foundation for more detailed
analysis of the architecture
• Assess the control in an architectural design (see next slide)
• Assess the data in an architectural design (see upcoming slide)
B. Apply the architecture trade-off analysis method
C. Assess the architectural complexity
Approach A: Questions -- Assessing
Control in an Architectural Design
• How is control managed within the architecture?
• Does a distinct control hierarchy exist, and if so, what is the role of
components within this control hierarchy?
• How do components transfer control within the system?
• How is control shared among components?
• What is the control topology (i.e., the geometric form that the control
takes)?
• Is control synchronized or do components operate asynchronously?
Approach A: Questions -- Assessing Data in
an Architectural Design
• How are data communicated between components?
• Is the flow of data continuous, or are data objects passed to the system
sporadically?
• What is the mode of data transfer (i.e., are data passed from one component
to another or are data available globally to be shared among system
components)
• Do data components exist (e.g., a repository or blackboard), and if so, what
is their role?
• How do functional components interact with data components?
• Are data components passive or active (i.e., does the data component
actively interact with other components in the system)?
• How do data and control interact within the system?
Approach B: Architecture Trade-off
Analysis Method
1) Collect scenarios representing the system from the user's point of view
2) Elicit requirements, constraints, and environment description to be certain all
stakeholder concerns have been addressed
3) Describe the candidate architectural styles that have been chosen to address the
scenarios and requirements
4) Evaluate quality attributes by considering each attribute in isolation (reliability,
performance, security, maintainability, flexibility, testability, portability, reusability,
and interoperability)
5) Identify the sensitivity of quality attributes to various architectural attributes for a
specific architectural style by making small changes in the architecture
6) Critique the application of the candidate architectural styles (from step #3) using
the sensitivity analysis conducted in step #5
☺
Building Blocks of UML
OOAD with UML
Building a Building software
house
Blueprint UML
Actual Coding
construction
A conceptual model of the UML
Operations
Figure 3: Collaborations
Figure 1: Classes
• use case - a description of set of sequence of actions that a system
performs that yields an observable result of value to a particular
actor. A use case is used to structure the behavioral things in a
model. A use case is realized by a collaboration.
• active class - a class whose objects own one or more processes or
threads and therefore can initiate control activity. An active class is
just like a class except that its objects represent elements whose
behavior is concurrent with other elements.
• component - a physical and replaceable part of a system that
conforms to and provides the realization of a set of interfaces.
Represents the physical packaging of otherwise logical elements,
such as classes, interfaces, and collaborations.
• node - a physical element that exists at run time and represents a
computational resource, having at least some memory and, often,
processing capability. A set of components may reside on a node
and may also migrate from node to node.
Figure 3: Use Cases
Figure 4: Active Classes
Figure 9: Packages
Figure 8: States
1. Dependencies: rendered as a
dashed line, possibly directed, and
occasionally including a label
3.Generalizations: rendered as a
solid line with a hollow arrowhead pointing to
the parent