Revisiting OOP
CS223
CS223- Object Oriented Programming
Spring 2012
Dr. Fawad Hussain
What we have done so far?
What is object-Oriented Programming?
What is an object?
What is a class?
What are attributes?
What are methods?
How to write a simple class in C++.
Constuctors
Default, overloaded, Destructors
But how to identify objects??
2
Ghulam Ishaq Khan Institute – Spring 2012
Todays Lecture
Revisiting OOP
Identifying Objects, basics of OO analysis and Design
3
OOP
Defining the term
“Object-Oriented”
4
Ghulam Ishaq Khan Institute – Spring 2012
What is an Object?
It is something we interact with
It does something, and/or
It knows something
Thinking in Objects
Everything Is an object.
Every object has an Name/Identity.
Every object has a state.
Every object has a behavior.
5
Ghulam Ishaq Khan Institute – Spring 2012
Objects in our Business World
6
Ghulam Ishaq Khan Institute – Spring 2012
My Object is not Your Object
What you recognize as an object may not be what others recognize as objects Different people can come of with different OO design of the same thing
But there must be some common features and reasoning
Different applications/softwares might treat objects differently
7
Ghulam Ishaq Khan Institute – Spring 2012
The world view
Is different depending on who you are
Goes from high level abstraction to low level realizations
The Universe, Solar system, Asia, South Asia, Pakistan, KPK,
Topi, GIK, FCSE, LH3
Video Rental Stores, Blockbusters, Inventory, Action Movies,
“Terminator”
“Terminator”
Why we care?
We use objects to model the system we are trying to create
Objects allow us to decompose a complex problem into understandable components
8
Ghulam Ishaq Khan Institute – Spring 2012
What is Object Oriented?
Simplicity through self contained objects
Complexity through integration
Interchangeability through framework
9
Ghulam