Design model consists of several subsystems which include several modeling elements
EX: specifying withdrawal, deposite operations in bank account class
Class diagram for online shopping
Class diagram for ATM System
Ooad content of unit v
Subject: Object Oriented Analysis and Design
B.Tech III Year II-Semester
Computer Science &Engineering
Table of Contents
Unit-V: The Design Workflow
• Design artifacts
• Design workflow
• Unified Process activity
• Architectural Design
• Design Classes
• Well formed design Classes
• Inheritance, Templates, Nested Classes
• Design Relationships
• Aggregation and Composition
• Refine Analysis Relationships
• Structured Classes
At the end of this unit the student will be in a position to:
• Model applications using UML
• Implement the software based on the design
• Understand the design workflow
• Understand the main principles of good Object Oriented design
• Understand the advantages of Design Templates.
• Describe the object-oriented software development process,
including object-oriented methodologies and workflows.
• Build libraries of re-useable classes using generalization and
• Model the use of technology and frameworks as series of design
• Generate frame code and keep the design and code models
The Unified Process is a software Development Process
A Software Development Process is a collection of activities needed to transform a
user’s requirements into a software System.
The Unified process repeats over a series of cycles making up the life of a system.
Each cycle consists of four phases
Inception: a good idea is developed into a vision of the end product
Elaboration: system architecture is designed
Construction: the product is built
Transition: the product is released
The several core workflows in Unified process takes place over the four
Requirement workflow: describes how to capture the requirements
Analysis workflow: analyzes the requirements by refining and structuring them
Design workflow: describes the design model
Implementation workflow: Describes the implementation model
Test workflow: describes the test model
The design work flow is the key modelling activity takes place during the last
part of the elaboration phase and the first half of the construction phase.
The aim of the design workflow is to refine the analysis workflow until that
can be implemented by the programmers.
Many nonfunctional requirements need to be finalized at this time, including
• Choice of programming language
• Reuse issues
• Portability issues
Analysis and design can occur in parallel to some extent
The purpose in analysis is to capture the functionalities that the system should
The purpose in design is to specify fully how this functionality will be
Analysis and Design Model
•Analysis classes comes from the real-world problem and it will give
representation of the problem domain
•Design classes comes from the problem domain to solution domain
Comparison of the Analysis and Design Model
• Analysis is a Conceptual Model
• Less formal
• Less expensive to develop
• Few layers
• Outline the design of the system
• May not be maintained
throughout the complete software
• Defines a structure that is an
essential input to shaping the
• Design is a Physical Model
• Not generic
• More formal
• More expensive
• Many layers
• Manifests the design of the system
• Should be maintained throughout
the complete software life cycle
• Shapes the system trying to
preserve the structure defined by
the analysis model
Design Artifacts-meta model
Meta model: The Design model contains many design sub systems.
These subsystems are components that contain many different types of
modelling elements. ssuch as classes, use cases, components and relationships among
Relationships between the analysis and design artifacts
Design models are made up of
i) Design subsystems
ii) Design classes
iv) Use case realizations design
Analysis Package Design subsystem
0..* <<trace>> 0..*
1 <<trace> 1
Use case realization
Use case realization-
Design Workflow: Which strives to preserve a structure of the system as
imposed by the analysis model, and which works as a blueprint of the
The design model includes
• Design subsystems
• Design Classes
• Use-case realizations
• The Architectural view of the design model
The Participants in design workflow are
the use case engineer and
the component engineer.
The architect will do architectural design.
The use case engineer will design a use case.
The component engineer will design classes and sub systems.
Design workflow Detail:
Use case Engineer
Design a use case
Component Engineer Design a class Design a sub system
Design workflow Detail:
The Architect: The Creation of the design is initiated by the Architect, who
outline the nodes and major subsystems and their interfaces.
The use-case engineer: realize each use case.
Component engineer: is responsible for creating design class, design sub
system, and interface.
UP activity: Architectural design.
In UP, Architectural design is important in the whole design process.
Architectural design activity is performed by one or more architects.
Architectural Design will identify
Nodes and their Network configuration
Subsystems and their interfaces
Architecturally significant design classes, such as active classes
Generic design mechanisms that handle common requirements
Use case model
Design class (outlined)
The next activities in design workflow are design a class and design a use case.
These two activities occur concurrently and iteratively.
The Design classes comes from problem domain and the solution domain.
Use case realization
Analysis class (complete)
Design a class
Design class (complete)
Design Classes (cont..)
• Analysis is about modelling what the system should do
• Design is about modelling how that behaviour maybe implemented.
• The design classes need to be complete enough to perform the task
• Fully specify the attributes including name, type, visibility and a default
• Fully specify the operations including name, parameter list and return type.
Examples for Analysis class and Design Class
Well Formed Design classes
Four minimal characteristics that a design class must have to be
considered well formed.
• Complete and Sufficient:
Completeness is making sure that the classes satisfy all reasonable client
Sufficient is keeping the design class as simple and focussed as possible.
Example: Bank account : withdrawals, deposit
for Bank account we need to specify all the methods which are sufficient
• Primitive: Class services should always be atomic unique and simple.
Example: Person class with functions getphone(), getpersonalrecords() etc.
Cohesion refers to what the class will do.
High cohesion mean that the class is focused on what it should be doing,
i.e. only methods relating to the intention of the class
Example: Like a credit card validation class, which is specialized to validate
credit cards only.
Another Example of High Cohesion: Staff
•As for coupling, it refers to how two
classes are related and how they
dependent on each other. Being low
coupling, changing something major
in one class should not affect the other.
Note: All good software design will go for high cohesion and low coupling.
• Inheritance is a mechanism by which more specific classes (subclasses or
derived classes) incorporate structure and behaviour of more general
classes (super classes or base classes).
• Inheritance is the strongest form of coupling between two classes.
Checking Account Savings Account Credit Account
Multiple inheritance: refer to the ability of a class to inherit behaviors and
features from more than one super class.
Ex: Multiple inheritance for Consultant Manager and Permanent Manager -
both inherit from two classes
aggregation and association
An aggregation is a special form of association that models a whole-part
relationship between an aggregate (the whole) and its parts.
Savings account Checking account
Association is Symmetric
Aggregation is asymmetric
Inheritance versus Interface realization
With Inheritance we can get two things.
Interface- the public operations of the base classes
Implementation – the attributes, relationships protected and private
operations of the base classes.
With interface realization, you get exactly one thing:
An Interface- A set of public operations attributes and relationships that
have no implementation.
• Inheritance and interface realization both have some common mechanisms
That allow you to define a contract that subclasses must implement. but
have very different semantics and usage.
• Inheritance is a kind of reuse which inheriting some implementation details
such as operations, attributes, relationships form a super class
• Interface realization is useful whenever you want to define a contract but
are not concerned about inheriting implementation details.
Note: Interface realization is more flexible and robust in some ways than
• Templates allow us to parameterize a type
• Instead of specifying the actual type of attributes, operations, return values
and operation parameters, you can define a class in terms of placeholders or
parameters. These may be replaced by actual values to create new classes.
example : template class Array
with two formal template
parameters. The first template
parameter T is an unconstrained
class template parameter. The
second template parameter n is
an integer expression template
Template binding for the bound
class Customers substitutes class
T with class Customer and
boundary n with integer value 24.
Place a class definition inside another class definition
Example: windows are part of wall and a window may consists of several frames of
different structures. The basic features of the frame class can be inherited by
Rectangle frame, circle frame etc..
Circle frame Square frame
Refining analysis relationships
Refining analysis relationships
Relationships captured in analysis are not implementable in design model.
To create a design model, you have to refine analysis association relationships
Several procedures to refine analysis associations to design associations
• Refining associations to aggregation or composition relationships
• Implementing One-to-many associations
• Implementing many-to-many associations
• Implementing many-to-many associations
• Implementing bidirectional associations
• Implementing association classes
Refining analysis relationships (cont..)
Association relationship must have
Multiplicity: How many are used
* => 0, 1, or more
1 => 1 exactly
3..* => 3 or more
Association Name : What relationships the object have
Role name: What role the object is playing
Aggregation: Special form of association
Specifies a whole- part relationship
–symbolized by a clear white diamond 1
Composition: is entirely made of
-Strong version of Aggregation
-the parts live and die with the whole
-symbolizes by a black diamond
How to Refine analysis relationships
• A one- to-one associations: Becomes composition
• A many-to- one association: can refine into aggregation
one- to- one
Each student must carry exactly one ID card
Many- to- one
One rectangle list can contain many rectangles
+ Rectangle(x: int, y: int, width:int, length: int
+contains(p: point): boolean
+distance(r: Rectangle): double
1 Carries 1
* contains 1
• These relationships are not directly supported by any of the commonly
used Object Oriented Languages
• The process of taking pure relationships and implementing them is
known as reification
Reify analysis relationships are
• Many-to-many association
• Bidirectional association
• Association classes
we have refied many -to-many association relationship into Aggregation & composition
1 * * 1
* Attends *
Student Attends Courses
A Theatre class uses the services of movie class and movie class uses the
services of theatre class .
Example: theatre class can premier several movies. movies are part of Theatre
i.e Aggregation. Movie premiered by Theatre i.e dependency.
Note: The bidirectional association is refied into aggregation and association
A modelling element that has both associations and class properties
Example: 1..* *
1 * * 1
Association class is refied into two aggregation relationships
Structured classifier is simply a class that has an internal structure
A role name: when a class participates in an association, it has a specific
role that it plays in that relationship
A type: Only instances of that type can play the role
A multiplicity: state how many objects may be connected across an
instance of an association
Unified Process: A unified process is a software development process
which provides a disciplined approach to assigning tasks and responsibilities
within a development organization.
Interface: Is a named set of operations that characterizes the behavior of an
Workflows: A workflow is a sequence of activities that produces a result of
Work flow details: these are used in the unified process to express a
specific group of closely related activities.
Classifier: A Mechanism that describes structural and behavioral features.
Generalization: A Specialization relationship, in which objects of the
Specialized element is substitutable for the generalized elements
1)Where the design workflow take places in the Software Development Life Cycle
a) First part of the Elaboration Phase b) Last part of the Elaboration phase
c) First part of the Transition Phase d) Last part of the Construction phase
2) Design Classes Comes from the ---------
a) Problem domain b) Solution Domain c) both a & b d) none
3) Good Software design will go for
a) High Coupling b) Low Cohesion c) High Cohesion and Low Coupling
d) Low Cohesion and High Coupling
4) Which two statements are true about interfaces?
a) The interface should have a clear purpose.
b) A single interface should include as many possible methods, if not all
methods, that may be shared by objects that implement the interface.
c) An interface should be used to restrict which methods are exposed to a
d) Classes may have multiple interfaces depending on the purpose of each
interface it implements.
5) What are the three purposes of Analysis and Design?
a) to provide an organizational context for the system
b) to transform the requirements into a design of the to-be system
c) to evolve a robust architecture for the system
d) to scope the system to be built and describe what it must do
e) to adapt the design to match the implementation environment
6) What happens when a super class is changed?
a) All subclasses inherit the change.
b) The operations of the subclass must be changed.
c) Additional operations in the subclass that are not associated with the super class
d) Only the operations of the super class are inherited.
7) Inheritance is the strongest form of _______________ between two classes
a) Cohesion b) Coupling c) both a & b d) none
8) Aggregation is ___________________
a) Asymmetric b) Symmetric c) both a & b d) none
9) How will you refine a one-to-one association in design model
a) Aggregation b) Composition c) interface d) Generalization
10) Bidirectional association can be refied in to ______________
a) Aggregation and unidirectional association
b) Aggregation and bidirectional association
c) Aggregation and dependency
d) Aggregation and generalization
1) B 2) C 3) C 4) A,D 5) B,C,E
6) A 7) B 8) A 9) B 10) A