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

Object-Oriented Programming (OOP) Lecture No. 1

This document provides an introduction to object-oriented programming (OOP). It defines OOP as a modeling technique that uses interacting objects. An object is something tangible like a person or car, or something intellectual like time or date. Objects have attributes that define their state, operations that define their behavior, and a unique identity. The document gives examples of objects like a person named Ali and a car to illustrate how objects have attributes, behaviors, and identities. It explains that OOP models map well to real-world things and are therefore easy to develop and understand.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views14 pages

Object-Oriented Programming (OOP) Lecture No. 1

This document provides an introduction to object-oriented programming (OOP). It defines OOP as a modeling technique that uses interacting objects. An object is something tangible like a person or car, or something intellectual like time or date. Objects have attributes that define their state, operations that define their behavior, and a unique identity. The document gives examples of objects like a person named Ali and a car to illustrate how objects have attributes, behaviors, and identities. It explains that OOP models map well to real-world things and are therefore easy to develop and understand.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 14

Object-Oriented Programming

(OOP)
Lecture No. 1
Object-Orientation (OO)
What is Object-Orientation?

►A technique for system modeling

► OO model consists of several interacting


objects
What is a Model?

►A model is an abstraction of something

► Purposeis to understand the product before


developing it
Examples – Model

► Highway maps

► Architectural models

► Mechanical models
Example – OO Model
…Example – OO Model
► Objects
lives-in
Ali House
 Ali
drives
 House
 Car
Car Tree
 Tree
► Interactions
 Ali lives in the house
 Ali drives the car
Object-Orientation - Advantages
► People think in terms of objects

► OO models map to reality

► Therefore, OO models are


 easy to develop
 easy to understand
What is an Object?
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
Example – Ali is a Tangible Object

► State (attributes)
 Name
 Age
► behaviour (operations)
 Walks
 Eats
► Identity
 His name
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
► behaviour (operations)
- Set Year - Set Day
- Set Month
► Identity
- Would have a unique ID in the model

You might also like