(OOP)Object Oriented Programming Concepts - A comprehensive tutorial to learn and understand the object oriented programming basic concepts part I

Previous | Next

What is OO (Object Orientation)?

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

 What is Model?

  • A model is an abstraction of something
  • Purpose is to understand the product before developing it
Examples could be
  • Architectural models
  • Mechanical models

What is Object?

  • Something Tangible (Danish, Car, House)
  • Something that can be detained intellectually (Time, Date)
An object has
    • State (attributes)
    • Well-defined behavior (operations)
    • Unique identity
Example: Danish is Tangible Object
  • State (attributes)
    • Name
    • Age
  • Behavior (operations)
    • Walks
    • Eats
  • Identity
    • His name

In pure OOP terms, an object is an instance of a class (A class is simply a representation of a type of object)

public class Student

Age int;
Name String;

EXAMPLE of OO ( Object Orientation)

What is Object Orientation Programming?

Object-oriented programming (OOP) is a programming paradigm based on the concept of "objects", which are data structures that contain data, in the form of fields, often known as attributes; and code, in the form of procedures, often known as methods. A distinguishing feature of objects is that an object's procedures can access and often modify the data fields of the object with which they are associated (objects have a notion of "this" or "self"). In OO programming, computer programs are designed by making them out of objects that interact with one another. There is significant diversity in object-oriented programming, but most popular languages are class-based, meaning that objects are instances of classes, which typically also determines their type. (WIKI)

  • Information is stored within the object
  • It is hidden from the outside world
  • It can only be manipulated by the object itself

For example
  • Ali’s name is stored within his brain
  • We can’t access his name directly
  • Rather we can ask him to tell his name
  • A phone stores several phone numbers
  • We can’t read the numbers directly from the SIM card
  • Rather phone-set reads this information for us

Previous | Next