Object-Oriented Modeling
and Design
Michael Blaha
James Rumbaugh
Introduction
Intention of OOMD is to learn how to apply object -
oriented concepts to all the stages of the software
development life cycle.
Object-oriented modeling and design is a way of
thinking about problems using models organized around
real world concepts.
The fundamental construct is the object, which combines
both data structure and behavior.
OO means that we organize software as a collection of
discrete objects.
There are four aspects required by an OO approach
Identity.
Classification.
Inheritance.
Polymorphism.
Identity:
Identity means that data is quantized into discrete,
distinguishable entities called objects.
E.g. for objects: personal computer, bicycle, queen in
chess etc.
Objects can be concrete or conceptual. Each object
has its own inherent identity.
Classification:
Classification means that objects with the same data
structure and behavior are grouped into a class.
E.g. paragraph, monitor, chess piece.
Each object is said to be an instance of its class.
Inheritance:
It is the sharing of attributes and operations among
classes based on a hierarchical relationship. A super class
has general information that sub classes refine and
elaborate.
E.g. Regular Customer and Privileged customer are the
subclasses of Customer.
Polymorphism:
Polymorphism means that the same operation may behave
differently for different classes.
For E.g. move operation behaves differently for a pawn
than for the queen in a chess game.
An operation is a procedure/transformation that an object
performs or is subjected to. An implementation of an
operation by a specific class is called a method.
OO Development
Development refers to the software life cycle: Analysis,
Design and Implementation.
The essence of OO Development is the identification and
organization of application concepts.
OO development is fundamentally a way of thinking and
not a programming technique
OO Methodology
The process consists of building a model of an
application and then adding details to it during design.
The methodology has the following stages
System conception: Software development begins
with business analysis or users conceiving an
application and formulating tentative requirements.
Analysis: The analyst scrutinizes and rigorously
restates the requirements from the system conception
by constructing models.
The analysis model is a concise, precise abstraction of what
the desired system must do, not how it will be done.
The analysis model has two parts
Domain Model- a description of real world objects
reflected within the system.
Application Model- a description of parts of the
application system itself that are visible to the user.
E.g. In case of stock broker application-
Domain objects may include- stock, bond, trade &
commission.
Application objects might control the execution of trades
and present the results.
System Design: The development teams devise a high-
level strategy- The System Architecture- for solving the
application problem.
The system designer should decide what performance
characteristics to optimize, chose a strategy of attacking
the problem, and make tentative resource allocations.
Class Design: The class designer adds details to the
analysis model in accordance with the system design
strategy.
Implementation: Implementers translate the classes and
relationships developed during class design into a
particular programming language, database or hardware.
Three models
Class Model—for the objects in the system & their
relationships.
It describes the static structure of the objects in the system and
their relationships.
Class model contains class diagrams- a graph whose nodes are
classes and arcs are relationships among the classes.
State model— for the life history of objects.
It describes the aspects of an object that change over time.
It specifies and implements control with state diagrams-a
graph whose nodes are states and whose arcs are transition
between states caused by events.
Interaction Model— for the interaction among
objects.
It describes how the objects in the system co-operate to
achieve broader results.
This model starts with use cases that are then elaborated
with sequence and activity diagrams.
Use case – focuses on functionality of a system – i.e
what a system does for users.
Sequence diagrams – shows the object that interact
and the time sequence of their interactions.
Activity diagrams – elaborates important processing
steps.
OO THEMES
Abstraction
Abstraction lets you focus on essential aspects of an
application while ignoring details i.e focusing on what an
object is and does, before deciding how to implement it.
It’s the most important skill required for OO
development.
Encapsulation (information hiding)
It separates the external aspects of an object from the
internal implementation details.
Encapsulation prevents portions of a program from
becoming so interdependent that a small change has
massive ripple effects.
Combining data and behavior
Caller of an operation need not consider how many
implementations exist.
In OO system the data structure hierarchy matches
the operation inheritance hierarchy .
Sharing
OO techniques provide sharing at different levels.
Inheritance of both data structure and behavior lets sub
classes share common code.
OO offers the prospect of reusing designs and code on
future projects.
Emphasis on the essence of an object
OO development places a greater emphasis on data
structure and a lesser emphasis on procedure structure than
functional-decomposition methodologies.
Synergy
Identity, classification, polymorphism and inheritance
characterize OO languages.
Each of these concepts can be used in isolation, but together
they complement each other synergistically.