Object-Orientation (OO)
What is Object-Orientation?
A technique for system modeling
Object-Orientation model consists of several
interacting objects
3
What is a Model?
A model is an abstraction of something
Purpose is to understand the product before
developing it
Examples – Model
Highway maps
Architectural models
Mechanical models
Example – OO Model
ALI lives in the house,
Ali drives the car
Ali drives the car and
also live in the house
…Example – Object-Olives-
Model
Objects
Ali in
House
Ali drives
House
Car
Tree
Tree
Interactions
Ali lives in the house
Ali drives the car
Object-Orientation -
Advantages
People think in terms of objects
Object-Orientation models map to reality
Therefore, Object-O models are
easy to develop
easy to understand
What is an Object?
An object is
Something tangible (Ali, Car) ; (we touch)
Something that can be apprehended intellectually
(Time, Date)
Automatically change like date and time
… What is an Object?
An object has
State (attributes); state attributes same
Ali hights, talking, character….
Well-defined behaviour (operations) ;Wo kia kam kr
sakta hai
Unique identity ; car ka registration number (ID)
Ali name unique
Example – Ali is a Tangible Object
State (attributes)
Name
Age
behaviour (operations)
Walks
Eats
Identity
His name; only one we have ali
Example – Car is a Tangible Object
State (attributes)
- Color
- Model
behaviour (operations)
- Accelerate - Start Car
- Change Gear
Identity
- Its registration number
Example – Time is an Object
Apprehended Intellectually
State (attributes)
- Hours - Seconds
- Minutes
behaviour (operations)
- Set Hours - Set Seconds
- Set Minutes
Identity
- Would have a unique ID in the model
Example – Date is an Object
Apprehended Intellectually
State (attributes)
Year - Day
Month
ehaviour (operations)
- Set Year - Set Day
- Set Month
Identity
- Would have a unique ID in the model