object oriented programming (oop) cs304 power point slides lecture 01
DESCRIPTION
this is the first lecture developed by virtual university of pakist about object oriented programming. very useful and a start from the very basics about OO modeling.TRANSCRIPT
Course Objective
Objective of this course is to make students familiar with the concepts of object-oriented programming
Concepts will be reinforced by their implementation in C++
Course ContentsObject-OrientationObjects and ClassesOverloadingInheritancePolymorphismGeneric ProgrammingException HandlingIntroduction to Design Patterns
BooksC++ How to Program
By Deitel & Deitel
The C++ Programming LanguageBy Bjarne Stroustrup
Object-Oriented Software EngineeringBy Jacobson, Christerson, Jonsson, Overgaard
Marks DistributionAssignments/Quizes 10%Presentation 5 %Attendance 5 %Mid Term 20 %Grading PolicyMarks Range (in %) Grade Point (Value) Grade91 and above 4.0 A+85-90 4.0 A77-84 3.5 B+70-76 3.0 B60-69 2.5 C+50-59 2.0 CBelow 50 0.0 F
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
Purpose is to understand the product before developing it
Examples – Model
Highway maps
Architectural models
Mechanical models
Example – OO Model
…Example – OO ModelObjects
Abu BakarHouseCarTree
InteractionsAbu Bakar lives in the houseAbu Bakar drives the car
Ali
Car
House
Tree
lives-in
drives
Object-Orientation - Advantages People think in terms of objects
OO models map to reality
Therefore, OO models areeasy to developeasy 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 ObjectState (attributes)
NameAge
behaviour (operations)WalksEats
IdentityHis name
Example – Car is a Tangible ObjectState (attributes)
- Color- Model
behaviour (operations)- Accelerate - Start Car- Change Gear
Identity- Its registration number
Example – Time is an Object Apprehended IntellectuallyState (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 IntellectuallyState (attributes)
- Year - Day- Month
behaviour (operations)- Set Year - Set Day- Set Month
Identity- Would have a unique ID in the model