0% found this document useful (0 votes)
4 views14 pages

Object Orientation

This document provides an overview of Object-Oriented Programming (OOP), focusing on the OO model which consists of interacting objects that represent real-world entities. It defines what a model is, illustrates examples of objects and their attributes, behaviors, and identities, and highlights the advantages of using OO models for system modeling. The document emphasizes that OO models are easy to develop and understand, making them effective for representing complex systems.

Uploaded by

ayeshanoor777325
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views14 pages

Object Orientation

This document provides an overview of Object-Oriented Programming (OOP), focusing on the OO model which consists of interacting objects that represent real-world entities. It defines what a model is, illustrates examples of objects and their attributes, behaviors, and identities, and highlights the advantages of using OO models for system modeling. The document emphasizes that OO models are easy to develop and understand, making them effective for representing complex systems.

Uploaded by

ayeshanoor777325
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

Object-Oriented Programming

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

 OO model consists of several interacting


objects

What is Object-Orientation?
 A model is an abstraction of something

 Purpose is to understand the product


before developing it

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

 OO models map to reality

 Therefore, OO models are


◦ easy to develop
◦ easy to understand

Object-Orientation - Advantages
An object is

 Something tangible (Ali, Car)

 Something that can be apprehended


intellectually (Time, Date)

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

Example – Ali is a Tangible


Object
 State (attributes)
- Color
- Model
 behaviour (operations)
- Accelerate - Start Car
- Change Gear
 Identity
- Its registration number

Example – Car is a Tangible


Object
 State (attributes)
- Hours - Seconds
- Minutes
 behaviour (operations)
- Set Hours - Set Seconds
- Set Minutes
 Identity
- Would have a unique ID in the model
Example – Time is an Object
Apprehended Intellectually
 State (attributes)
- Year - Day
- Month
 behaviour (operations)
- Set Year - Set Day
- Set Month
 Identity
- Would have a unique ID in the model

Example – Date is an Object


Apprehended Intellectually

You might also like