Object Oriented Analysis &
Design – ITC 1153
Department of Information and Communication Technology
Faculty of
Technology
University of Sri Jayewardenepura
Outline of the lecture
Basic Principles of Object Orientation
- Abstraction
-
Encapsulation
-
Modularity
Hierarchy
A comparison between OOAD and SSAD
Basic Principles of Object Orientation
Object Orientation
Encapsulation
Abstraction
Modularity
Hierarchy
What is Abstraction ?
• Focuses on the essential features of an properties
• The essential features are relative to the context in
which the object is being used.
• Definition of Grady Booch: “An abstraction denotes the
essential characteristics of an object that distinguish it
Student
concisely defined conceptual boundaries, relative to the
enrolement_number
perspective of the viewer.”
name
Address
pulse_rate
size_of_shoe
pulse_rate and size_of_shoe should be
eliminated, since they are irrelevant in the
perspective of the educational institute.
Exercise Patient Nimal
enrolement_number
name
Student Nimal
DoB
course
enrolement_number Address
name Pulse_rate
size_of_shoe
Address
pulse_rate
size_of_shoe
What is Encapsulation ?
• Encapsulation is the process of binding both attributes
and methods together within a class.
• Through encapsulation, the internal details of a class can
be hidden from outside.
• Hide implementation from clients
Class
• Data and methods are encapsulated as an object
corrupted by other objects. Also, other objects are Attributes
protected from changes in the object implementation.
Methods
• Encapsulation allows objects to be viewed as `black
boxes'.
What is Modularity?
•Modularity is the process of decomposing a problem
(program) into a set of modules in order to reduce the overall
complexity of the problem.
•Modularity is a technique used to master complexity (“divide
and conquer”)
Booch’s definition:
•“Modularity is the property of a system that has been
decomposed into a set of cohesive and loosely coupled
modules.”
Order
Entry
Order Processing Order
System Fulfillment
Billing
Modularity can be visualized as a way of mapping encapsulated
abstractions into real, physical modules having high cohesion
within the modules and their inter–module interaction or coupling
University Student Information System
registration
Results
Bursary/Mahapola
Attendance
Accommodation/hostel
What is Hierarchy?
• In Grady Booch’s words, “Hierarchy is the ranking or
ordering of abstraction”.
interrelated subsystems, which can have their own
subsystems and so on until the smallest level
components are reached.
• Hierarchy allows code reusability.
contd.. What is Hierarchy?
• Levels of abstraction Asset
Increa
sing
abstraction
BankAccount Security RealEstate
Savings Current Stock Bond
Decrea Elements at the same level of the hierarchy
sing should be at the same level of abstraction
abstraction
The two types of hierarchies in OOA are:
•“IS–A” hierarchy : It defines the hierarchical relationship in
inheritance, whereby from a super-class, a number of subclasses may
if we derive a class car from a class vehicle, we can say that a car
“is–a” vehicle.
• “PART OF” hierarchy :It defines the hierarchical relationship in
aggregation by which a class may be composed of other classes. For
example, a car is composed of engine, tyres, seats, etc. It can be said
that a engine is a “part of” car.
Two important hierarchies
“Part of” hierarchy
“Is kind of” hierarchy
Is-Kind-of
Hierarchy
Comparison between two methodologies: OOAD & SSAD
SSAD evolved OOAD evolved
from Structured from object
oriented
programming
SSAD is Process OOAD is Data Oriented:
Oriented: Consequently Consequently data is the
the processes are the primary focus of the
primary focus of the system
system
SSAD breaks down the OOAD breaks down
system through the use the system through
of data flow diagrams the use of use cases
(DFD)
For OOAD the components
are derived from the class
For SSAD the components diagrams and the Unified
of the system are derived Modelling Language
from the DFD’s
For SSAD there are definable
steps: planning, analysis, design, For OOAD there is an iterative and
and implementation from start to incremental approach involving
finish for the systems continuous testing and refinement of
development life cycle the system from start to finish
In SSAD there is a In OOAD there is
separation of the encapsulation of the
systems data and system data and
processes processes