Object Orientation
Object Orientation
Lecture No. 2
OO Model
Book: Object-Oriented P rogram m ing w ith C++ by David P arsons, 2nd Ed.
Chatper-4
Object-Orientation (OO)
A technique for system modeling
What is Object-Orientation?
A model is an abstraction of something
What is a Model?
Highway maps
Architectural models
Mechanical models
Examples – Model
Example – OO Model
Objects
◦ Ali
◦ House lives-in
◦ Car Ali House
◦ Tree
drives
Interactions
◦ Ali lives in the house
◦ Ali drives the car Car Tree
…Example – OO Model
People think in terms of objects
Object-Orientation - Advantages
An object is
What is an Object?
An object has
State (attributes)
Well-defined behaviour (operations)
Unique identity
… What is an Object?
State (attributes)
◦ Name
◦ Age
behaviour (operations)
◦ Walks
◦ Eats
Identity
◦ His name