Transitioning from Analysis to Design Model
Transitioning from Analysis to Design Model
1
FROM Analysis Model TO Design Model
System Description
(by a customer)
List of System
Specifications
system
description (that system engineer
and code developer
Analysis Model understands)
analysis
model
Design Model
design
model
Lists of System
Requirements
(that customer still
understands) System Development
by code developers -
technologists and
technicians
2
Design Model as a Bridge between Analysis M. and Code Dev.
(using the By Analogy method)
Analysis of
Customer Req. Design Model (blueprints) Development
3
Analysis Model outcomes (several examples)
4
General idea: Design Model’s expected outcomes =
Analysis Model’s actual outcomes + our ADDITIONAL design proposals
Additional
design specs
Addit. design
specs
Examples of Analysis Model specs:
1) 28 different types of actors (from use cases, from context DFD, ...)
2) At least 567 different functions … (from COs, from STD, …)
3) At least 21 different types of data structures – stacks, files, arrays, lists, queues, databases, … 6
(from Level-0 DFD, …)
Design
3. Data/Classes data/class design that transforms the information domain Design Model
model into the particular data structures (as in 9th Ed., p. 158)
7
FROM Analysis Model TO Design Model
Maps into
Analysis model
(DOs, DFDs, ERDs, STDs,
activity diagrams, use cases,
etc.)
Design model
(architecture, components,
data, interfaces)
Software modules
8
From Analysis Model to Design Model
(details)
Design Model
Co m p o n e n t -
sc e n a r i o - b a se d f l ow- or 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
Analy sis Model
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
9
Systems Thinking Based Approach
in Systems’ Engineering
10
Software Engineer:
A Profile Required by Industry these days
A set of composition of skills of software engineer required by industry/businesses, and companies:
Systems Thinking is very useful in software engineering and development because software applications
can be seen as subsystems in larger organizational systems, taking input from, and
returning output to, their organizational environments.
12
What is a difference between a Technician,
Technologist and an Engineer?
[Link]
13
A System and its Characteristics
A system is an inter-related set of components, with an identifiable boundary,
working together for some purpose.
2) Boundary - a line (probably, a physical line and/or a virtual line) that separates
the system from its environment
1 4 6
8
Environment
Purpose/
System 2
Goal
3
9
Constraints
7
/Limits 5
17
IEEE standards: Views of Software System
A subsystem
A component
Level of Sub-elements,
…... Details (for ex., attributes)
(Detail View)
19
MyBradley Software System at Bradley U.:
Development/Structural View (system, subsystems, and component design)
System Level
System (MyBradley system)
A subsystem
A component
20
Software Design: Systems Eng.-based approach (1/2)
Design - is a meaningful engineering representation of something that must be built.
In Software Engineering context (as proposed by R. Pressman et al), Software Design focuses on:
1) Goal.
Goal of software design is to produce a model or representation that is
- bug free (firmness),
- suitable for its intended uses (commodity), and
- pleasurable to use (delight).
4) Interfaces interface design describes how the software communicates within itself, with other
systems, and with users/actors/collaborators
21
Software Design: Additional Systems’ Features
that must be considered in SW Design Process due to
System’s Thinking approach (2/2) – this approach will
significantly improve quality of to-be-developed system
22
Software Systems’ Design:
Concepts
23
Software Design: Concepts
24
1.1. Data Abstraction
(abstractive data models not actual objects)
door
manufacturer
model number
type
swing direction
inserts
lights
type
number
weight
opening mechanism
Abstraction - allows designers to simplify a problem and focus on solving a problem without being
concerned about irrelevant lower level details
25
1.2. Procedural Abstraction (solution algorithms)
open
details of enter
algorithm
Abstraction - allows designers to simplify a problem and focus on solving a problem without being
concerned about irrelevant lower level details
(en example: procedural abstraction: a subroutine – a named sequence of actions and events) 26
Examples of algorithms’ representations
[Link]
[Link] 27
Example of algorithm’s
representation
(extreme case = coding)
Note:
a) Software Engineering
is NOT a coding;
b) Coding is NOT
Software Engineering
28
2. Software Architecture (details during next class)
The overall structure of the software and the ways in which that
structure provides conceptual integrity for a system
Structural properties. This aspect of the architectural design representation 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.
(Details – in Ch. 9)
29
System’s Architecture: an example (structural view)
A subsystem
A component
Level of Sub-elements,
…... Details (for ex., attributes)
(Detail View)
30
3. Patterns
(Reusability of previous designs and design solutions)
Pattern name describes the essence of the pattern in a short but expressive name
Intent describes the pattern and its functions
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
32
Patterns: Analogy in Heavy Machinery by Caterpillar: CT660 Truck
(reusability of previous designs and design solutions)
Caterpillar CT660
(concrete pump model)
Caterpillar CT660
(concrete mixer
model)
33
3a. Patterns (details)
A design pattern is a general reusable solution to a commonly occurring problem in software design.
A design pattern is not a finished design that can be transformed directly into code.
It is a description or template for how to solve a problem that can be used in many different situations.
34
3a. Patterns (details)
35
3a. Patterns (details)
36
Example of
Highly
Reusable
Base
Software
System
37
4. Modular Design
(easier to build, easier to change, easier to fix…)
*) Boeing 747
Microsoft Design Center:
*) modern cars (standard modules)
Industrialization and modular object-oriented
*) reusable learning objects (modules of online
software development has theoretically made it
courses)
easy to tear things down and replace them.
38
Modular Approach of Software Systems
(easier to build, easier to change, easier to fix…)
39
Modularization vs Decomposition
Modularization Decomposition
cost of
software
module
integration
cost
[Link] 42
Sizing Modules: Two Views
One important feature of a module is
its length.
Longer is not better.
Level of Components
Level of elements
44
BTW: Pedagogical Patterns (details)
45
5. Information Hiding
(or, Encapsulation in Programming)
module • algorithm
controlled
interface • data structure
• details of external interface
• resource allocation policy
clients "secret"
47
6. Functional Independence
Functional independence is achieved by
developing modules with "single-minded"
function and an "aversion" (disliking) to
excessive interaction with other modules.
Object
open
Activity Diagram (textual form)
walk to door;
reach for knob;
open door; repeat until door opens
turn knob clockwise;
walk through; if knob doesn't turn, then
close door. take key out;
find correct key;
insert in lock;
endif
pull/push door
move out of way;
end repeat
Instructions (code)
49
Stepwise Refinement: An example
Processing
unit: main
function
50
FROM Analysis Model TO Design Model
(it is actually a refinement process)
high
a na ly sis m ode l
class diagrams
analysis packages
use-cases - t ext class diagrams
Requirement s:
CRC models use-case diagrams const raint s
analysis packages
collaborat ion diagrams
act ivit y diagrams CRC models int eroperabilit y
dat a f low diagrams sw im lane diagrams collaborat ion diagrams t arget s and
cont rol-f low diagrams collaborat ion diagrams dat a f low diagrams
processing narrat ives st at e diagrams cont rol-f low diagrams
conf igurat ion
sequence diagrams processing narrat ives
st at e diagrams
sequence diagrams
process dimension
51
An example of Structural View as a refinement process
System Level
System (Webster System)
A subsystem
A component
52
The Bottom Line: FROM Analysis Model TO Design Model
(based on Analysis Model of we will be able
to create the system’s Design Model)
Maps into
Analysis model
(DOs, DFDs, ERDs, STDs,
activity diagrams, use cases,
etc.)
Design model
(architecture, components,
data, interfaces)
Software modules
53
8. Re-factoring
In software engineering, "refactoring" of source code means improving it
without changing its overall results, and is sometimes informally referred
to as "cleaning it up". Refactoring neither fixes bugs nor adds new
functionality, though it might precede either activity. Rather, it improves the
understandability of the code, changes its internal structure and design,
and removes dead code.
54
8a. Re-factoring Techniques
(not a comprehensive list at all)
Encapsulate Field - force code to access the field with getter and setter methods
Generalize Type - create more general types to allow for more code sharing
Replace type-checking code with State/Strategy
Replace conditional with polymorphism
Extract Method, to turn part of a larger method into a new method. By breaking down code in
smaller pieces, it is more easily understandable. This is also applicable to functions.
Extract Class moves part of the code from an existing class into a new class.
Rename Method or - changing the name into a new one that better reveals its purpose
Pull Up - in OOP, move to a superclass
Push Down - in OOP, move to a subclass
Source: [Link] 55
8b. Re-factoring Tools (in alphabetical order)
Add Parameter Parameterize Method
Change Bidirectional Association to Unidirectional Preserve Whole Object
Change Reference to Value Pull Up Constructor Body
Change Unidirectional Association to Bidirectional Pull Up Field
Change Value to Reference Pull Up Method
Collapse Hierarchy Push Down Field
Consolidate Conditional Expression Push Down Method
Consolidate Duplicate Conditional Fragments Reduce Scope of Variable by Mats Henricson
Convert Dynamic to Static Construction by Gerard M. Davison Refactor Architecture by Tiers (Link Only)
Convert Static to Dynamic Construction by Gerard M. Davison Remove Double Negative by Ashley Frieze and Martin Fowler
Decompose Conditional Remove Middle Man
Duplicate Observed Data Remove Parameter
Eliminate Inter-Entity Bean Communication (Link Only) Remove Setting Method
Encapsulate Collection Rename Method
Encapsulate Downcast Replace Array with Object
Encapsulate Field Replace Assignment with Initialization by Mats Henricson
Extract Class Replace Conditional with Polymorphism
Extract Interface Replace Conditional with Visitor by Ivan Mitrovic
Extract Method Replace Constructor with Factory Method
Extract Package by Gerard M. Davison Replace Data Value with Object
Extract Subclass Replace Delegation with Inheritance
Extract Superclass Replace Error Code with Exception
Form Template Method Replace Exception with Test
Hide Delegate Replace Inheritance with Delegation
Hide Method Replace Iteration with Recursion by Dave Whipp
Hide presentation tier-specific details from the business tier (Link Only) Replace Magic Number with Symbolic Constant
Inline Class Replace Method with Method Object
Inline Method Replace Nested Conditional with Guard Clauses
Inline Temp Replace Parameter with Explicit Methods
Introduce A Controller (Link Only) Replace Parameter with Method
Introduce Assertion Replace Record with Data Class
Introduce Business Delegate (Link Only) Replace Recursion with Iteration by Ivan Mitrovic
Introduce Explaining Variable Replace Static Variable with Parameter by Marian Vittek
Introduce Foreign Method Replace Subclass with Fields
Introduce Local Extension Replace Temp with Query
Introduce Null Object Replace Type Code with Class
Introduce Parameter Object Replace Type Code with State/Strategy
Introduce Synchronizer Token (Link Only) Replace Type Code with Subclasses
Localize Disparate Logic (Link Only) Reverse Conditional by Bill Murphy and Martin Fowler
Merge Session Beans (Link Only) Self Encapsulate Field
Move Business Logic to Session (Link Only) Separate Data Access Code (Link Only)
Move Class by Gerard M. Davison Separate Query from Modifier
Move Field Split Loop by Martin Fowler
Move Method Split Temporary Variable
Substitute Algorithm
Use a Connection Pool (Link Only)
Source: [Link] Wrap entities with session (Link Only) 56
Code
Re-Factoring
Tool:
An Example
57
Systems’ Design Concepts
Additional Information
58
Software Design Concepts:
Davis’95 SW Design Principles
59
Software Design Principles = Best Practices
(Davis’95)
1) The design process should not suffer from limited view = ‘tunnel vision.’
*) a good designer should consider several (3-5) alternatives and judge them based on given
requirements
(for ex: technical platforms or programming languages for a new SW system)
4) The design should “minimize the intellectual distance” between the software and
the problem as it exists in the real world.
*) SW design solutions should be as close (whenever possible) to the real-world problem
domain as possible;
(for ex: simulate user -- kids, students, professionals, etc. -- behavior
and level of their knowledge and perception;)
61
Software Design Principles (cont.)
7) The design should be structured to degrade gently, even when aberrant data,
events, or operating conditions are encountered.
*) Use messages, progress bars, etc. as often as possible
(for ex: “System shut-down is in progress”, “System is experiencing problems with …”
BUTNO “blue screen of death …)
63
Software Design: Guidelines that are required by Quality
A design should exhibit an architecture that (1) has been created using recognizable architectural styles or
patterns, (2) is composed of components that exhibit good design characteristics and (3) can be implemented
in an evolutionary fashion
For smaller systems, design can sometimes be developed linearly.
A design should be modular; that is, the software should be logically partitioned into elements or
subsystems
A design should contain distinct representations of data, architecture, interfaces, and components.
A design should lead to data structures that are appropriate for the classes to be implemented and are
drawn from recognizable data patterns.
A design should lead to interfaces that reduce the complexity of connections between components and
with the external environment.
A design should be derived using a repeatable method that is driven by information obtained during
software requirements analysis.
A design should be represented using a notation that effectively communicates its meaning.
64
Software Design Engineering
Design principles establish an overriding philosophy that guides the designer as the work is
performed
Design concepts must be understood before the mechanics of design practice are applied
Software design practices change continuously as new methods, better analysis, and broader
understanding evolve
65