Docsity

Object-Oriented Programming (OOP) Lecture 1: Understanding Objects and Classes, Slides of Object Oriented Programming

Partial preview of the text

Download Object-Oriented Programming (OOP) Lecture 1: Understanding Objects and Classes and more Slides Object Oriented Programming in PDF only on Docsity!

Object-Oriented Programming

(OOP)

Lecture No. 1

Course Objective

►

Objective of this course is to make studentsfamiliar with the concepts of object-orientedprogramming

►

Concepts will be reinforced by theirimplementation in C++

Books

►

C++ How to Program

By Deitel & Deitel

►

The C++ Programming Language

By Bjarne Stroustrup

►

Object-Oriented Software Engineering

By Jacobson, Christerson, Jonsson, Overgaard

Grading Policy

►

Assignments

►

Group Discussion

►

Mid-Term

►

Final

What is Object-Orientation?

►

A technique for system modeling

►

OO model consists of several interactingobjects

What is a Model?

►

A model is an abstraction of something

►

Purpose is to understand the product beforedeveloping it

Example – OO Model

…Example – OO Model

►

Objects

Ali

House

Car

Tree

►

Interactions

Ali lives in the house

Ali drives the car

Ali Car

House

Tree

lives-in

drives

What is an Object?

An object is ►

Something tangible (Ali, Car)

►

Something that can be apprehendedintellectually (Time, Date)

… What is an Object?

An object has ►

State (attributes)

►

Well-defined behaviour (operations)

►

Unique identity

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