SE Module 3.1
SE Module 3.1
CSE
V SEMESTER
UNIT – IIUN
Module-III- II
Contents
SOFTWARE DESIGN
Design process:
• Design concepts,
• Design model, design heuristic,
• Architectural design architectural styles,
• Architectural design, and architectural mapping using data flow.
• Initially, the blue print depicts a holistic view of software. That is, the design
is represented at a high level of abstraction— a level that can be directly
traced to the specific system objective and more detailed data, functional, and
behavioral requirements.
◾ Firmness: A program should not have any bugs that inhibit its function.
was intended
Quality Guidelines
• A design should be modular; that is, the software should be logically partitioned into
elements or subsystems.
• A design should lead to data structures that are appropriate for the classes to be
implemented and are drawn from recognizable data patterns.
Quality Guidelines ..
Quality attributes
• Functionality is assessed by evaluating the feature set and capabilities of the
program, the generality of the functions that are derived and the security of the
overall system
• The evolution of software design is a continuing process that has now spanned
almost six decades.
–Process dimension indicating the evolution of the design model as design tasks
are executed as part of the software process.
• Architectural level
• Component level
• Databases and files
• Data structures
Design model
• The architectural design for software is the equivalent to the floor plan of a
house.
• The floor plan depicts the overall layout of the rooms; their size, shape, and
relationship to one another; and the doors and windows that allow movement into
and out of the rooms.
• The floor plan gives us an overall view of the house.
• Architectural design elements give us an overall view of the software.
6
Design model
Component-level design elements
7
Design model
Component Elements
Sensor
SensorManagemen t
8
Design model
9
Component-level design
9
Component-level design
Software component
Define
•
d
A software component is a modular building block for computer
software
– It is a modular, deployable, and replaceable part of a system that
encapsulates implementation and exposes a set of interfaces
• A component communicates and collaborates with
– Other components
– Entities outside the boundaries of the system
• Three different views of a component
– An object-oriented view
– A conventional view
– A process-related view
5 9
Component-level design
Object-oriented View
•
Define
A component is viewed as a set of one or more collaborating classes
•
d to identify all attributes and
Each problem domain (i.e., analysis) class and infrastructure (i.e.,
design) class is elaborated
operations that apply to its implementation
– This also involves defining the interfaces that enable classes to
communicate and collaborate
• This elaboration activity is applied to every component defined as
part of the architectural design
• Once this is completed, the following steps are performed
1) Provide further elaboration of each attribute, operation, and interface
2) Specify the data structure appropriate for each attribute
3) Design the algorithmic detail required to implement the processing
logic associated with each operation
4) Design the mechanisms required to implement the interface to include
the messaging that occurs between objects
5
6 9
Component-level design
Conventional View
•
Define
A component is viewed as a functional element (i.e., a module) of a
d
program that incorporates
– The processing logic
– The internal data structures that are required to implement the processing
logic
– An interface that enables the component to be invoked and data to be
passed to it
• A component serves one of the following roles
– A control component that coordinates the invocation of all other problem
domain components
–
A problem domain component that implements a complete or partial
function that is required by the customer
–
An infrastructure component that is responsible for functions that support
the processing required in the problem domain
9
Component-level design
Define
Process-related View
d
• Emphasis is placed on building systems from existing components
maintained in a library rather than creating each component from
scratch
• As the software architecture is formulated, components are selected
from the library and used to populate the architecture
• Because the components in the library have been created with reuse in
mind, each contains the following:
– A complete description of their interface
– The functions they perform
– The communication and collaboration
they require
9 9
Component-level design
11
Component-level design
13
Component-level design
Cohesion
• Cohesion is the “single-mindedness’ of a component
• It implies that a component or class encapsulates only attributes and
operations that are closely related to one another and to the class or
component itself
• The objective is to keep cohesion as high as possible
• The kinds of cohesion can be ranked in order from highest (best) to
lowest (worst)
– Functional
• A module performs one and only one computation and then returns a result
– Layer
• A higher layer component accesses the services of a lower layer component
– Communicational
• All operations that access the same data are defined within one class
15
Component-level design
Coupling
Coupling (continued)
• Other kinds of coupling (unranked)
– Subroutine call coupling
• When one operation is invoked it invokes another operation within side of it
– Type use coupling
• Component A uses a data type defined in component B, such as for an instance
variable or a local variable declaration
• If/when the type definition changes, every component that declares a variable
of that data type must also change
– Inclusion or import coupling
• Component A imports or includes the contents of component B
– External coupling
• A component communicates or collaborates with infrastructure components
that are entities external to the software (e.g., operating system functions,
database functions, networking functions)
18
Component-level design
Conducting Component-Level Design
1) Identify all design classes that correspond to the problem domain as defined
in the analysis model and architectural model
2) Identify all design classes that correspond to the infrastructure domain
• These classes are usually not present in the analysis or architectural models
• These classes include GUI components, operating system components, data
management components, networking components, etc.
1) Elaborate all design classes that are not acquired as reusable
components
a) Specify message details (i.e., structure) when classes or components collaborate
b) Identify appropriate interfaces (e.g., abstract classes) for each component
c) Elaborate attributes and define data types and data structures required to
implement them (usually in the planned implementation language)
d) Describe processing flow within each operation in detail by means of pseudocode
or UML activity diagrams
20
Component-level design
22
Component-level design
T F
Sequence If-then-else
T
F F
T
F T
T
F
Selection Repetition
23
Graphical Example used for Algorithm Analysis
1 int functionZ(int y) 3
2 {
3 int x = 0;
4
4 while (x <= (y * y))
5 { 6 7
6 if ((x % 11 == 0) &&
7 (x % y == 0))
9
8
9
{
printf(“%d”, x);
12 13
10 x++;
11 } // End if 10
12 else if ((x % 7 == 15
13 0) ||
14 (x % y == 16
15 1))
16 { 18
17 printf(“%d”, y);
18 x = x + 2;
19 } // End else 20
printf(“\n”);
20 } // End of list\n");
printf("End 21
21 while
return 0;
22 } // End functionZ 24
Software Architecture
1
Software Architecture
• Architectural design represents the structure of data and program
components that are required to build a computer-based system.
• It considers the architectural style that the system will take, the structure
and properties of the components that constitute the system, and the
interrelationships that occur among all architectural components of a system
2
Software Architecture
Why Is Architecture Important?
•Representations of software architecture are an enabler for communication between
all parties, interested in the development of a computer-based system.
•The architecture highlights early design decisions that will have a profound impact
on all software engineering work that follows and, as important, on ultimate success
of the system as an operational entity.
•Architecture constitutes a relatively small, intellectually graspable model of how
the system is structured and how its components work together.
3
Software Architecture
Architectural Descriptions
• Each of us has a mental image of what the word architecture means.
In
reality, however, it means different things to different people.
• The implication is that different stakeholders will see an architecture from
different viewpoints that are driven by different sets of concerns.
•An architectural description is actually a set of work products that
•reflect different views
An architectural of the system.
description exhibit of a software-based system
mustbuilding.
characteristics that are analogous to those noted for the office
•Developers want clear, decisive guidance on how to proceed with design.
• Customers want a clear understanding on the environmental changes that must
occur and assurances that the architecture will meet their business needs.
Software Architecture
Architectural Decisions
•Each view developed as part of an architectural description addresses a
specific stakeholder concern.
•To develop each view (and the architectural description as a whole) the system
architect considers a variety of alternatives and ultimately decides on the specific
architectural features that best meet the concern.
• Therefore, architectural decisions themselves can be considered to be one view
of the architecture.
• The reasons that decisions were made provide insight into the structure of a
system and its conformance to stakeholder concerns.
Software Architectural Styles
8
Software Architectural Style
• The software that is built for computer-based systems exhibit one of many
architectural styles
• Each style describes a system category that encompasses
– A set of component types that perform a function required by the system
– A set of connectors (subroutine call, remote procedure call, data stream,
socket) that enable communication, coordination, and cooperation
among components
– constraints that define how components can be integrated to
form the system;
– semantic models that enable a designer to understand the
overall properties of a system by analyzing the known
properties of its constituent parts
9
Abrief Taxonomyof ArchitecturalStyles
Independent
Components
Communicati Event
ng Processes Systems
Implicit Explicit
Client/Server Peer-to-Peer Invocati Invocati
on on
Data Data-Centered
Flow
Virtual Call
Machine andReturn
Shared Data
12
Software Architectural Style
Data-flow architectures
• This architecture is applied when input data are to be transformed through a
series of computational or manipulative components into output data.
• A pipe-and-filter pattern shows has a set of components, called
filters, by pipes that transmit data from one component to the next.
connected
• Each filter works independently of those components upstream
and
downstream, is designed to expect data input of a certain form,
and
produces data output (to the next filter) of a specified form.
• However, the filter does not require knowledge of the workings of
its
neighboring filters.
Data Flow Style
pipe
fIilter
14
Software ArchitecturalStyle
Call and return architectures.
• This architectural style enables you to achieve a program structure that
is
relatively easy to modify and scale.
••Main
A number of substyles exist within
program/subprogram this category:
architectures: This classic program structure
decomposes function into a control hierarchy where a
invokes a number of program program turn
components
other that Figure illustrates an architecture of this type. may
components. invoke
• Remote call architectures: The still
components of a main
procedure
program/subprogram architecture are distributed multiple
across
computers on a network.
Call-and-Return Style
Main module
Subroutine B
SubroutineA
SubroutineA-1 SubroutineA-2
Transport layer
Data layer
Class Z
Physical layer
16
Software ArchitecturalStyle
Object-oriented architectures
•The components of a system encapsulate data and the operations that must
be
applied to manipulate the data.
•Communication and coordination between components are accomplished via
message passing.
Layered architectures.
• The basic structure of a layered architecture is illustrated in Figure.
•A number of different layers are defined, each accomplishing operations
that progressively become closer to the machine instruction set.
•At the outer layer, components service user interface operations.
••At the inner layer,layers
Intermediate components perform
provide operating
utility system
services and interfacing.
application
Software functions.
Layered architectures
Architectural Patterns
• As the requirements model is developed, you’ll notice that the software must
address a number of broad problems that span the entire application.
• For example, the requirements model for virtually every e-commerce
application is faced with the following problem: How do we offer a broad
array of goods to a broad array of customers and allow those customers to
purchase our goods online?
• Architectural patterns address an application-specific problem within a
specific context and under a set of limitations and constraints. The pattern
proposes an architectural solution that can serve as the basis for architectural
design.
19
Software Architectural
Organization and Refinement
•Because the design process often leaves you with a number of architectural alternatives, it is
important to establish a set of design criteria that can be used to assess an architectural design
that is derived.
Control.
•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?
Data.
•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 (e.g., a blackboard or repository) exist, 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?
Architectural Design Steps
• As architectural design begins, the software to be developed must be
put into context—that is, the design should define the external
entities (other systems, devices, people) that the software interacts
with and the nature of the interaction.
1
Architectural Design Steps
2
Architectural Design Steps
"Super"ordinatesystems
Usedby
I/ I/ I/
Use
F F F
s
Target
system Produces
Produceso or Peer
Actors I/ I/ consumes s
r
F F Depends
consumes
on
"Sub"ordinate
systems 3
Arhitectural Design Steps
• 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
• those systems that are used by the target system and provide data or
processing that are necessary to complete target system functionality
- Peer-level systems
• Interact on a peer-to-peer basis with target system to produced or
consumed by peers and target system
– Actors
• People or devices that interact with target system to produce or consume
data
4
Architectural Design Steps
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
•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
The archetypes and their relationships can be
•system
– illustrated
They can beinderived from class
a UML the analysis class model
diagram
5
Architectural Design Steps
6
Archetypes – their attributes
7
Archetypes – their methods
8
Architectural Design Steps
9
Architectural Design Steps
• AUML classdiagram can represent the classesof the refined
architecture and their relationships
10
Architectural Design Steps
11
Architectural Mapping using Data
• Transform mapping is a set of design steps that allows a DFD with
transform flow characteristics to be mapped into a specific
architectural style.
– Information must enter and exit software in an ͞exterŶal
world͟ . Such externalized data must be converted into an
internal form for processing. Information enters along paths that
transform external data into an internal form. These paths are identified
are Incoming flow.
– Incoming data are transformed through a transform center and move along
the paths that now lead o͞ ut͟ of the software. Data moving along thesepaths are
called Outgoing flow.
• Transaction Flow
– flow Is often characterized by a Singledata item
called Transaction, that triggers other data flow along one of many paths.
Information
– Transaction flow is characterized by data moving along an incoming path
that converts external world information into a transaction
– The transaction is evaluated and, based on its value, flow along one of
many action paths is initiated. The hub of information from which many
action paths emanate is called a transaction center
1
Architectural Mapping using Data
Flow
Flow Characteristics
Transform flow
Transaction
flow
2
Architectural Mapping using Data
Flow
• Transform Mapping
1. Review the fundamental system model.
2. Review and refine data flow diagrams for the software
3. Determinewhether the DFD has transform or transaction flow
characteristics.
4. Isolate the transform center by specifying incoming and outgoing flow
boundaries.
5. Perform f͞ irst-level factoring
6. Perform ͞second-level factoring
7.Refinethe first-iteration architecture using design heuristics for
improved software quality.
3
Architectural Mapping using Data
Flow
Transform Mapping
g h
b
a f
d e
c i
j
data flow model
x1
"Transform" mapping
x2 x3 x4
b c d e f g i
a h j
4
Architectural Mapping using Data
Factoring
direction of increasing
decision making typical "decision
making"
modules
5
Architectural Mapping using Data
Flow
First Level Factoring
main program
controller
6
Architectural Mapping using Data
SecondLevel
Factoring
main
D
C
control
A
B
A
B
C
7
Architectural Mapping using
Data
• Transaction Mapping
1. Review the fundamental system model.
2. Review and refine data flow diagrams for the software
3. Determine whether the DFD has transform or transaction flow
characteristics.
4. Isolate the transaction center and the flow characteristics along each of
the
action paths.
5. Map the DFD in a program structure amenable to transaction processing.
6. Factor and refine the transaction structure and the structure of each
action path.
7. Refine the first-iteration architecture using design heuristics for improved
software quality.
8
Architectural Mapping using Data
Flow
isolate Flow Paths
error
command msg
produce fixturesetting
read error
msg status format
comman
d determine
invalidcommand setting setting
validate read raw setting
command fixture
command
combined
status status
determine
validcommand type
read
robot control record record
calculate
output
send values values
control
value format
report
assembly report
record
start/stop
10
Architectural Mapping using Data
Flow
TransactionMapping
Data flow f
model
a e
b d
t mapping x1
g i program
l h structure
k
b t
j
m
a x2 x3 x4
n
d e f g l m n
h x3.1
i j
9
Architectural Mapping using
Data Flow
Map the
FlowModel
process
operator
commands
command determine
input type
controller
11
Architectural Mapping using Data
Flow
Refining
process
operator
command
s
comman determin
d input e
controller type
12
Architectural Mapping using Data Flow