Unit 3
Unit 3
1
UNIT 4 SYLLABUS
• Design Engineering : Design process and
Design quality, Design concepts, the design
model.
• Creating an architectural design : Software
architecture, Data design, Architectural styles
and patterns, Architectural Design.
2
Software Design
• Design ->The first step in the development phase for any engineered
product.
• It serves as the foundation for all software engineering and software
maintenance steps that follow.
• The design model provides detail about the software data structures,
architecture, interfaces, and components.
• The design model can be assessed for quality and be improved before
code is generated and tests are conducted
– Does the design contain errors, inconsistencies, or omissions?
– Are there better design alternatives?
– Can the design be implemented within the constraints, schedule,
and cost that have been established?
4
Design Engineering
• It covers the set of principles, concepts, and practices that
lead to the development of a high quality system or product.
• Goal of design engineering is to produce a model or
representation that depict:
– Firmness – program should not have any bug that inhibits its functions.
– Commodity – suitable to its intended use.
– Delight - pleasurable to use
• The design model provides detail about software data
structures, architecture, interfaces, and components that are
necessary to implement the system.
Software Design
• Software design model consists of 4
designs:
– Data/class Design
– Architectural Design
– Interface Design
– Component Design
Translating Analysis Design
• Data/class design - Created by transforming the analysis
model class-based elements into classes and data structures
required to implement the software
• Architectural design - defines the relationships among the
major structural elements of the software, it is derived from
the class-based elements and flow-oriented elements of the
analysis model
• Interface design - describes how the software elements,
hardware elements, and end-users communicate with one
another, it is derived from the analysis model scenario-based
elements, flow-oriented elements, and behavioral elements
• Component-level design - created by transforming the
structural elements defined by the software architecture into a
procedural description of the software components using
information obtained from the analysis model class-based
elements, flow-oriented elements, and behavioral elements
Why design is so important?
• It is place where quality is fostered.
• It provides us with representation of software that can be
assessed for quality.
• Only way that can accurately translate a customer’s
requirements into a finished software product.
• It serves as foundation for all software engineering
activities.
• Without design difficult to assess:
– Risk
– Test
– Quality
Design Process and Design Quality
• S/w design is an iterative process through which
requirements are translated into a “blueprint” for
constructing the s/w.
• As design iteration occur, subsequent refinement leads
to design representation at much lower levels of
abstraction.
• Design creates a representation or model of the software
– Quality is established during Design
– Design should exhibit firmness, commodity and
design
– Design sits at the kernel of S/W Engineering
– Design sets the stage for construction
The Engineering
Design Process
→Begins with a recognition of need for a
product, service, or system
1) A design should lead to data structures that are appropriate for the classes
to be implemented and are drawn from recognizable data patterns.
• Usability
* user-friendliness
* Aesthetics
* Consistency
* Documentation
• Reliability
* Evaluated by measuring the frequency and severity of failure
* MTTF
• Performance
* Processing Speed, Response Time
* Resource Consumption
* Efficiency
• Supportability
* Extensibility
* Adaptability 16
* Serviceability
Design Concepts
• Design concepts provide the necessary framework for
“to get the thing on right way”.
1. Abstractions
2. Architecture
3. Patterns
4. Modularity
5. Information Hiding
6. Functional Independence
7. Refinement
8. Re-factoring
9. Design Classes
Abstraction
• At the highest level of abstraction – a solution is stated in broad
terms
• At lower level of abstraction – a more detailed description of the
solution is provided.
20
Modularity
• Architecture and design pattern embody modularity.
- Modular decomposability:
a design method provides a systematic mechanism for decomposing the
problem into sub-problems --> reduce the complexity and achieve the
modularity
- Modular composability:
• a design method enables existing design components to be assembled into a
new system.
- Modular understandability:
• a module can be understood as a standalone unit it will be easier to build and
easier to change.
- Modular continuity:
• small changes to the system requirements result in changes to individual
modules, rather than system-wide changes.
- Modular protection:
• an aberrant condition occurs within a module and its effects are constrained
within the module.
Information Hiding
• Modules should be specified and designed so that information
(algorithm and data) contained within a module is inaccessible to
other modules that have no need for such information.
• Independence is important –
– Easier to develop
– Easier to Test and maintain
– Error propagation is reduced
– Reusable module.
26
Advantages of Functional
Independence
• Better understandability and good design:
– Complexity of design is reduced,
– Different modules easily understood in isolation:
• modules are independent
Coupling
• Measure of interconnection among modules
• Coupling is a measure of the relative interdependence among
modules.
→ Coupling should be low and cohesion should be high for good design
Cohesion
A measure of how well a component “fits
together”.
• A component should implement a single logical
entity or function.
Sequential
Communicational
Procedural
Temporal
Logical
• Procedural cohesion: Elements are related only by sequence, i.e. all part
of a procedure (algorithm)
Common
Control
Stamp
• Stamp coupling : Two modules are stamp coupled, if they communicate via
a composite data item.
• Control coupling: Data from one module is used to direct order of instruction
execution in another.
• Common coupling : Two modules are common coupled, if they share some
global data.
38
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
39
Types of Design Classes
→ Class represents a different layer of design architecture.
41
Dimensions of the Design
Model
High
Analysis model
Abstraction Dimension
Design model
analysis model
class diagrams
analysis packages
use-cases - text class diagrams
Requirements:
CRC models use-case diagrams constraints
analysis packages
collaboration diagrams
activity diagrams CRC models interoperability
data flow diagrams swim lane diagrams collaboration diagrams targets and
control-flow diagrams collaboration diagrams data flow diagrams
processing narratives state diagrams control-flow diagrams
configuration
sequence diagrams processing narratives
state diagrams
sequence diagrams
process dimension
Design Model (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
Data/Class Design
44
Design Model
1. Data Design elements
Data design creates a model of data that is represented at a high level
of abstraction.
The structure of data has always been an important part of software design.
Includes :
o User interface
o External interfaces to other systems, devices etc
o Internal interfaces between various components 46
Interface Elements
MobilePhone
WirelessPDA
Cont rolPanel
LCDdisplay
LEDindicators
keyPadCharacteristics K eyPad
speaker
wirelessInterface
readKeyStroke()
decodeKey ()
displayStatus()
lightLEDs()
sendControlMsg()
readKeystroke()
decodeKey()
SensorManagement
Sensor
48
Design Model
5. Deployment level design elements
Security homeownerAccess
Personal computer
externalAccess
Security Surveillance
homeManagement communication
51
Design Pattern Template
• Pattern name—describes the essence of the pattern in a short but
expressive name
• Intent—describes the pattern and what it does
• Also-known-as—lists any synonyms for the pattern
• Motivation—provides an example of the problem
• Applicability—notes specific design situations in which the pattern is
applicable
• Structure—describes the classes that are required to implement the pattern
• Participants—describes the responsibilities of the classes that are required
to implement the pattern
• Collaborations—describes how the participants collaborate to carry out
their responsibilities
• Consequences—describes the “design forces” that affect the pattern and
the potential trade-offs that must be considered when the pattern is
implemented
• Related patterns—cross-references related design patterns
Using Patterns In Design
• Once the analysis phase is done the designer can use the pattern which
can help him examine about how the problem to be solved and the
constraints that are imposed by problem.
• Design patterns
– provides a scheme for refining the subsystems or components of a
software system, relationships among components, or the mechanisms
for effecting inter-component communication or solve some design
problem
Objectives
• To introduce architectural design and to discuss its
importance
Two Levels
Data Design
Architectural Design
Software Architecture
WHAT.. ??
• “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, and the relationships among them.”
WHY.. ??
• It is not operational software but it is representation that enables
software engineer to
– Analyze the effectiveness of design in meeting its stated
requirement.
– consider architectural alternatives at a stage when making
design changes is still relatively easy,
– reduce the risks associated with the construction of the
software.
Importance of Software Architecture
• Representations of software architecture are an enabler
for communication between all parties (stakeholders)
interested in the development.
1. constraints that define how components can be integrated to form the system
It can be represent by
– Data-centered architecture
– Data flow architecture
– Call and return architecture
– Object oriented architecture
– Layered architecture.
A Taxonomy of Architectural
Styles
Data Flow
Data-Centered
65
Data-centered architecture
• A data store (e.g., a file or database) resides at the center of this
architecture and is accessed frequently by other components that update,
add, delete, or otherwise modify data within the store.
Batch Sequential
Call-and-Return Style
• Architecture style enables a software designer (system architect) to achieve a
program structure that is relatively easy to modify and scale.
• Layered system
– Assigns components to layers in order to control inter-component interaction
– Only allows a layer to communicate with its immediate neighbor
– Assigns core functionality such as hardware interfacing or system kernel
operations to the lowest layer
– Builds each successive layer on its predecessor, hiding the lower layer and
providing services for the upper layer
– Is compromised by layer bridging that skips one or more layers to improve
runtime performance
73
Layered architecture
82
Architectural Design
• The software must be placed into context
– the design should define the external entities (other
systems, devices, people) that the software interacts
with and the nature of the interaction
• A set of architectural archetypes should be identified
– An archetype is an abstraction (similar to a class) that
represents one element of system behavior
• The designer specifies the structure of the system by
defining and refining software components that
implement each archetype
83
1. Represent the System in
Context
• Use an architectural context diagram (ACD) that shows
– The identification and flow of all information into and out of a system
– The specification of all interfaces
– Any relevant support processing from/by other systems
• An ACD models the manner in which software interacts with entities external to
its boundaries
• An ACD identifies systems that interoperate with the target system
– Super-ordinate systems
• Use target system as part of some higher level processing scheme
– Sub-ordinate systems
• Used by target system and provide necessary data or processing
– Peer-level systems
• Interact on a peer-to-peer basis with target system to produce or
consume data
– Actors
• People or devices that interact with target system to produce or consume
data 84
Represent the System in Context
"Super"ordinate systems
Used by
Target system
Produces or
Produces or consumes Peers
Actors consumes I/F I/F
Depends on
"Sub"ordinate systems
85
Architectural Context
Safehome Internet-based
Product system
control
panel target system: surveillance
Security Function function
uses
homeowner peers
uses
uses
sensors sensors
86
2. Define Archetypes
• Archetypes indicate the important abstractions within the problem
domain (i.e., they model information)
• An archetype is a class or pattern that represents a core abstraction
that is critical to the design of an architecture for the target system
• It is also an abstraction from a class of programs with a common
structure and includes class-specific design strategies and a
collection of example program designs and implementations
• Only a relatively small set of archetypes is required in order to
design even relatively complex systems
• The target system architecture is composed of these archetypes
– They represent stable elements of the architecture
– They may be instantiated in different ways based on the
behavior of the system
– They can be derived from the analysis class model
• The archetypes and their relationships can be illustrated in a UML
class diagram
Archetypes
Controller
communicates with
Node
Detector Indicator
Function
selection
External
Communication
Management
GUI Internet
Interface
90
4. Describe Instantiations of the
System
• An actual instantiation of the architecture is developed
by applying it to a specific problem
External
Communication
Management
Security
GUI Internet
Interface
Keypad
processing phone
scheduler
communicat ion
CP display
funct ions
alarm
sensor
sensor
sensor
sensor
sensor
sensor
sensor
sensor
92 sensor
Assessing Alternative Architectural
Designs
Various Assessment Approaches
94
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?
• 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?
95
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
96
Approach C: Assessing Architectural
Complexity
• The overall complexity of a software architecture can be
assessed by considering the dependencies between
components within the architecture
• These dependencies are driven by the information and control
flow within a system
• Three types of dependencies
– Sharing dependency UV
• Represents a dependency relationship among consumers who use the
same source or producer
– Flow dependency UV
• Represents a dependency relationship between producers and
consumers of resources
– Constrained dependency U “XOR” V
• Represents constraints on the relative flow of control among a set of
activities such as mutual exclusion between two components
97
Approach D: Architectural
Description Language
• Architectural Description Language (ADL)
provides a semantics and syntax for describing a
software architecture.