Design Concepts in Software Engineering
Design Concepts in Software Engineering
Design
Mitch Kapor, presented a software design
manifesto. He said:
The
architectural
design
defines
the
relationship
between
major
structural
elements of the software, the architectural
styles and design patterns that can be used to
achieve the requirements defined for the
system, and the constraints that affect the
way
in
which
architecture
can
be
implemented.
Importance of software
quality
Design is the place where quality is fostered in software
engineering.
Design provides you with representations of software that can
be assessed for quality.
Design is the only way that you can accurately translate
stakeholders requirements into a finished software product or
system.
Software design serves as the foundation for all the software
engineering and software support activities that follow.
Without design, you risk building an unstable system
one that will fail when small changes are made;
One that may be difficult to test;
one whose quality cannot be assessed until late in the software
process, when time is short and many dollars have already been
spent.
8
Quality Guidelines
A design should exhibit an architecture that (1) has been created using
Quality Attributes
Hewlett-Packard developed a set of software quality attributes that
has been given the acronym FURPSfunctionality, usability,
reliability, performance, and supportability. The FURPS quality
attributes represent a target for all software design:
Functionality is assessed by evaluating the feature set and
capabilities of the program, the generality of the functions that are
delivered, and the security of
the overall system.
Usability is assessed by considering human factors, consistency,
and documentation.
Reliability is evaluated by measuring the frequency and severity of
failure, the accuracy of output results, the mean-time-to-failure
(MTTF), the ability to recover from failure, and the predictability of
the program.
Performance is measured by considering processing speed,
response time, resource consumption, throughput, and efficiency.
12
Supportability
13
Design Concepts
Abstractiondata, procedure, control
Architecturethe overall structure of the software
Patternsconveys the essence of a proven design solution
Separation of concernsany complex problem can be more easily handled if it is
15
1.Abstraction:
When you consider a modular solution to any problem,
16
Procedural
Abstraction
open
details of enter
algorithm
17
18
Data
door
Abstraction
manufacturer
model number
type
swing direction
inserts
lights
type
number
weight
opening mechanism
19
2. Architecture
The overall structure of the software and the ways
provides
conceptual
defines the components of a system (e.g., modules, objects, filters) and the
manner in which those components are packaged and interact with one
another. For example, objects are packaged to encapsulate both data and the
processing that manipulates the data and interact via the invocation of
methods
Extra-functional properties. The architectural design description should
address how the design architecture achieves requirements for performance,
capacity, reliability, security, adaptability, and other system characteristics.
Families of related systems. The architectural design should draw upon
21
3. Patterns
Brad Appleton defines a design pattern in the following
manner: A pattern is a named nugget of insight which
conveys the essence of a proven solution to a recurring
problem within a certain context amidst competing
concerns
The intent of each design pattern is to provide a
description that enables a designer to determine
(1) whether the pattern is applicable to the current work,
(2) whether the pattern can be reused (hence, saving
design time), and
(3) Whether the pattern can serve as a guide for
developing a similar, but functionally or structurally
different pattern.
23
24
4. Separation of
Any complex problem can be more easily handled if
Concerns
it is subdivided into pieces that can each be solved
and/or optimized independently
25
Modularity
Software is divided into separately named and addressable components,
In almost all instances, you should break the design into many modules,
27
28
and
long-term maintenance can be conducted without serious side effects.
testing and debugging can be conducted more efficiently,
29
Information Hiding
The principle of information hiding suggests that modules be
30
Information
module
Hiding
algorithm
controlled
data structure
interface
details of external interface
resource allocation policy
clients
"secret"
Functional
Functional independence is achieved by developing modules with
Independence
"single-minded"
function and an "aversion" to excessive interaction
32
structure.
Coupling depends on the interface complexity between modules, the point at
which entry or reference is made to a module, and what data pass across the
interface.
In software design, you should strive for the lowest possible coupling.
Simple connectivity among modules results in software that is easier to
understand and less prone to a ripple effect , caused when errors occur at one
location and propagate throughout a system.
33
Refinement
A program is developed by successively refining levels of
procedural detail.
A hierarchy is developed by decomposing a macroscopic
statement of function (a procedural abstraction) in a stepwise
fashion until programming language statements are reached.
Refinement is actually a process of elaboration.
You begin with a statement of function (or description of
information) that is defined at a high level of abstraction.
That is, the statement describes function or information
conceptually but provides no information about the internal
workings of the function or the internal structure of the
information.
You then elaborate on the original statement, providing more
and more detail as each successive refinement (elaboration)
occurs.
34
Stepwise
open
Refinement
walk to door;
reach for knob;
open door;
walk through;
close door.
Aspects
Consider two requirements, A and B. Requirement
36
AspectsAn Example
Consider two requirements for the SafeHomeAssured.com WebApp.
37
Refactoring
refactoring is a reorganization technique that
is examined for
redundancy
unused design elements
inefficient or unnecessary algorithms
poorly constructed or inappropriate data structures
or any other design failure that can be corrected to
38
OO Design
Concepts
Design classes
Inheritanceall responsibilities of a superclass is
39
Design Classes
As the design model evolves, you will define a set of design classes that
refine the analysis classes by providing design detail that will enable the
classes to be implemented, and implement a software infrastructure that
supports the business solution.
Five different types of design classes, each representing a different layer of
the design architecture, can be developed
User interface classes define all abstractions that are necessary for human
computer interaction (HCI).
Business domain classes are often refinements of the analysis classes
defined earlier. The classes identify the attributes and services (methods)
that are required to implement some element of the business domain.
Process classes implement lower-level business abstractions required to
fully manage the business domain classes.
Persistent classes represent data stores (e.g., a database) that will persist
beyond the execution of the software.
System classes implement software management and control functions
that enable the system to operate and communicate within its computing
environment and with the outside world.
40
41
Low coupling:
Within the design model, it is necessary for design classes to
42
43
44
45
Design Model
Elements
Data elements
Architectural elements
Application domain
Analysis classes, their relationships, collaborations and
Interface elements
the user interface (UI)
external interfaces to other systems, devices, networks or
Component elements
Deployment elements
46
47
Architectural Design
Elements
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.
48
Architectural Design
The
architectural model is derived from three
Elements
sources:
software to be built;
specific requirements model elements such as data
flow diagrams or analysis classes, their relationships
and collaborations for the problem at hand, and
the availability of architectural patterns and styles.
49
(and specifications) for the doors, windows, and external utilities of a house.
These drawings depict the size and shape of doors and windows, the manner
in which they operate, the way in which utility connections (e.g., water,
electrical, gas, telephone) come into the house and are distributed among the
rooms depicted in the floor plan.
They tell us where the doorbell is located, whether an intercom is to be used
and external utilities tell us how things and information flow into and out of
the house and within the rooms that are part of the floor plan.
The interface design elements for software depict information flows into and
50
design:
(1) the user interface (UI);
(2) external interfaces to other systems, devices,
networks, or other producers or consumers of
information; and
(3) internal interfaces between various design
components.
These interface design elements allow the software
to communicate externally and enable internal
communication and collaboration among the
components that populate the software architecture.
51
52
Component-Level Design
Elements
The component-level design for software is the equivalent to a set
53
A UML Component
Diagram
SensorManagement
Sensor
54
57
58
Software Architecture
The software architecture of a program or computing
59
In
60
Why Is Architecture
Important?