Docsity

Object-Oriented Programming (OOP) Course: Understanding Objects, Classes, and Interactions, Slides of Object Oriented Programming

Partial preview of the text

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

Object-Oriented Programming

(OOP)

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

Object-Orientation (OO)

What is Object-Orientation?

  • A technique for system modeling
  • OO model consists of several interacting objects

Examples โ€“ Model

  • Highway maps
  • Architectural models
  • Mechanical models

Example โ€“ OO Model

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)

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 โ€“ 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