object oriented programming (oop) cs304 power point slides lecture 01

18

Upload: adil-kakakhel

Post on 13-Dec-2014

4.921 views

Category:

Education


7 download

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

Page 1: Object oriented programming (oop)   cs304 power point slides lecture 01
Page 2: Object oriented programming (oop)   cs304 power point slides lecture 01

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++

Page 3: Object oriented programming (oop)   cs304 power point slides lecture 01

Course ContentsObject-OrientationObjects and ClassesOverloadingInheritancePolymorphismGeneric ProgrammingException HandlingIntroduction to Design Patterns

Page 4: Object oriented programming (oop)   cs304 power point slides lecture 01

BooksC++ How to Program

By Deitel & Deitel

The C++ Programming LanguageBy Bjarne Stroustrup

Object-Oriented Software EngineeringBy Jacobson, Christerson, Jonsson, Overgaard

Page 5: Object oriented programming (oop)   cs304 power point slides lecture 01

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

Page 6: Object oriented programming (oop)   cs304 power point slides lecture 01
Page 7: Object oriented programming (oop)   cs304 power point slides lecture 01

What is Object-Orientation?

A technique for system modeling

OO model consists of several interacting objects

Page 8: Object oriented programming (oop)   cs304 power point slides lecture 01

What is a Model?

A model is an abstraction of something

Purpose is to understand the product before developing it

Page 9: Object oriented programming (oop)   cs304 power point slides lecture 01

Examples – Model

Highway maps

Architectural models

Mechanical models

Page 10: Object oriented programming (oop)   cs304 power point slides lecture 01

Example – OO Model

Page 11: Object oriented programming (oop)   cs304 power point slides lecture 01

…Example – OO ModelObjects

Abu BakarHouseCarTree

InteractionsAbu Bakar lives in the houseAbu Bakar drives the car

Ali

Car

House

Tree

lives-in

drives

Page 12: Object oriented programming (oop)   cs304 power point slides lecture 01

Object-Orientation - Advantages People think in terms of objects

OO models map to reality

Therefore, OO models areeasy to developeasy to understand

Page 13: Object oriented programming (oop)   cs304 power point slides lecture 01

What is an Object?An object is

Something tangible (Ali, Car)

Something that can be apprehended intellectually (Time, Date)

Page 14: Object oriented programming (oop)   cs304 power point slides lecture 01

… What is an Object?An object has

State (attributes)Well-defined behaviour (operations)Unique identity

Page 15: Object oriented programming (oop)   cs304 power point slides lecture 01

Example – Ali is a Tangible ObjectState (attributes)

NameAge

behaviour (operations)WalksEats

IdentityHis name

Page 16: Object oriented programming (oop)   cs304 power point slides lecture 01

Example – Car is a Tangible ObjectState (attributes)

- Color- Model

behaviour (operations)- Accelerate - Start Car- Change Gear

Identity- Its registration number

Page 17: Object oriented programming (oop)   cs304 power point slides lecture 01

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

Page 18: Object oriented programming (oop)   cs304 power point slides lecture 01

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