Object Oriented Thinking
Primary version
Primary version
  • Introduction
  • Abstraction
    • Abstraction
    • What is abstraction
    • Programming Languages
    • Advantages of Abstraction
    • Pseudo Code Example
  • All about Objects
    • All About Objects
    • What are Objects
    • Why OOP
    • Classes
    • Interface of an Object
    • Reusing Implementation
    • Characteristics of OOP
  • Glossary and Sources
    • Sources
Powered by GitBook
On this page
  1. All about Objects

Characteristics of OOP

Alan Kay, a renowned computer scientist, listed the five characteristics of Smalltalk, the first successful object oriented programming language and one of the languages on which C++ is based. They summarize the characteristics that represent a pure approach to object oriented programming:

  1. Everything is an Object. An object contains both data and behavior (this is also knows as encapsulation). It keeps state and can satisfy outside requests by performing operations on itself. You can basically create objects of any conceptual component in the problem you are trying to solve (people, buildings, lists, records, ...).

  2. A program is a bunch of objects telling each other what to do by sending messages. To make a request of an object, a message needs to be send to it. This will call a certain method of that particular object.

  3. Each object has its own memory made up of other objects. Think of this as creating another type of object by packaging together other objects, this will later be seen as what is called composition. This allows us to hide complexity behind the simplicity of objects. In other words, objects allows to create new levels of abstraction.

  4. Every object has a type. Or in OOP lingo, each object is an instance of a class in which class actually is a synonym of type. A class defines what messages can be send to the objects of that particular class.

  5. All objects of a particular type can receive the same messages. This is a bit more complex than it sounds. Basically, an object of type circle is also an object of type shape, meaning that a circle object will be guaranteed to also accept shape messages. This is where polymorphism comes into play: meaning you can write code that talks to shapes and automatically handles other objects that also fit the description of shapes, such as circles. This substitutability forms one of the most powerful concepts of OOP.

PreviousReusing ImplementationNextSources

Last updated 6 years ago