13-Design Concepts-06-02-2024
13-Design Concepts-06-02-2024
1
Design
Design creates a representation or model of the
software, but unlike the requirements model
(that focuses on describing required data,
function, and behavior), the design model
provides detail about
– software architecture,
– data structures,
– interfaces, and
– components
that are necessary to implement the system.
2
Design
• Design allows you to model the system or product
that is to be built
• Design is the place where software quality is
established.
• The quality of the design is assessed with a series of
technical reviews
work product:
A design model that encompasses architectural,
interface, component level, and deployment
representations is the primary work product that is
produced during software design.
3
Requirements Model -> Design Model
Co m p o n e n t -
sc e n a r i o - b a se d f l o w- o r i e n t e d L e v e l D e sig n
e l e me nt s e l e me nt s
use-cases - text data flow diagrams
use-case diagrams control-flow diagrams
activity diagrams processing narratives
swim lane diagrams
In t e r f a c e D e sig n
Analysis Model
A r c h it e c t u r a l D e sig n
c l a ss- b a se d be ha v i or a l
e l e me nt s e l e me nt s
class diagrams state diagrams
analysis packages sequence diagrams
CRC models D a t a / Cla ss D e sig n
collaboration diagrams
Design Model
4
Design Principles
• The design process should not suffer from ‘tunnel vision.’
• The design should be traceable to the analysis model.
• The design should not reinvent the wheel.
• The design should “minimize the intellectual distance” between
the software and the problem as it exists in the real world.
• The design should exhibit uniformity and integration.
• The design should be structured to accommodate change.
• The design should be structured to degrade gently, even when
aberrant data, events, or operating conditions are encountered.
• Design is not coding, coding is not design.
• The design should be assessed for quality as it is being created,
not after the fact.
• The design should be reviewed to minimize conceptual (semantic)
errors.
8
Design Concepts
1. Abstraction—data, procedure, control
2. Architecture—the overall structure of the software
3. Patterns—”conveys the essence” of a proven design solution
4. Separation of concerns—any complex problem can be more easily
handled if it is subdivided into pieces
5. Modularity—compartmentalization of data and function
6. Hiding—controlled interfaces
7. Functional independence—single-minded function and low coupling
8. Refinement—elaboration of detail for all abstractions
9. Aspects—a mechanism for understanding how global requirements
affect design
10. Refactoring—a reorganization technique that simplifies the design
11. OO design concepts
12. Design Classes—provide design detail that will enable analysis
classes to be implemented
9
1. Abstraction
Abstraction can be posed at the highest level or lowest
level
door
manufacturer
model number
type
swing direction
inserts
lights
type
number
weight
opening mechanism
11
2. Architecture
“The overall structure of the software and the ways in which
that structure provides conceptual integrity for a system.”
13
4. Separation of Concerns
• Any complex problem can be more easily
handled if it is subdivided into pieces that can
each be solved and/or optimized
independently
• A concern is a feature or behavior that is
specified as part of the requirements model
for the software
• By separating concerns into smaller, and
therefore more manageable pieces, a
problem takes less effort and time to solve.
14
5. Modularity
"modularity is the single attribute of software that allows a
program to be intellectually manageable".
MODULE
16
Modularity: Trade-offs
What is the "right" number of modules for a specific
software design?
cost of
software module
integration
cost
clients
"secret"
18
Why Information Hiding?
• Reduces the likelihood of “side effects”
• limits the global impact of local design decisions
• emphasizes communication through controlled
interfaces
• discourages the use of global data
• leads to encapsulation—an attribute of high
quality design
• Avoids inadvertent errors introduced during
modification
• results in higher quality software
19
7. Functional Independence
• Functional independence is achieved by
developing modules with ‘single minded’
function
• It avoids excessive interaction with modules
• Independent modules are easier to develop
and maintain, side-effects reduced, error
propagation is reduced and reusability is
possible
20
7. Functional Independence
• Functional independence is achieved by two
factors: Cohesion and Coupling
• A cohesive module performs a single task and
it requires a small interaction with the other
components in other parts of the program.
• Coupling is an indication of interconnection
between modules in a structure of software.
• Coupling depends on the interface complexity
between the modules
• Increase the cohesion and decrease the
coupling 21
Coupling vs Cohesion
22
23
8. Stepwise Refinement
open
walk to door;
reach for knob;
24
9. Aspects
• Consider two requirements, A and B.
Requirement A crosscuts requirement B “if
a software decomposition [refinement] has
been chosen in which B cannot be
satisfied without taking A into account.
• An aspect is a representation of a cross-
cutting concern.
• It is important to identify aspects so that
the design can accommodate them
25
Aspects—An Example
• Consider two requirements for the SafeHomeAssured.com
WebApp. Requirement A is described via the use-case
Access camera surveillance via the Internet. A design
refinement would focus on those modules that would enable a
registered user to access video from cameras placed
throughout a space. Requirement B is a generic security
requirement that states that a registered user must be
validated prior to using SafeHomeAssured.com. This
requirement is applicable for all functions that are available to
registered SafeHome users. As design refinement occurs, A*
is a design representation for requirement A and B* is a
design representation for requirement B. Therefore, A* and B*
are representations of concerns, and B* cross-cuts A*.
30