[   ^ to index...   |   next -->   ]

CSE 143/AC : 27 June 2000


Object-oriented programming

What is object-oriented programming? Well, it all goes back to Plato. Plato posited that there are actually two worlds:

  1. The world of forms, which is a world which contains one ideal representative for every "kind" of object in our world.
  2. The world of shadows, which is the world we live in. Every object in the world of shadows is a shadow of its "ideal" in the world of forms.

In OOP, we model the universe using objects, which have the following properties:

State
Properties of the object. If I have a stick of chalk, its state might include its length.


Behavior
The things you can do with the object. For a stick of chalk, usually the only thing I can do is write things with it until it goes away. It does not make sense, for example, to drive a piece of chalk, because a stick of chalk is not a vehicle.


Identity
Each object is unique. No two sticks occupy the same position at the same time.

In order to make the universe manageable, we group objects into classes, which are "kinds" of objects. Notice that above, I have used the implicit notion that there is such a thing as "chalk", and that I can have a "stick" of it.

This is where we return to Plato: in object-oriented programming, the notion of "chalk", corresponding to the "ideal form of chalk", would be encapsulated in a class. Instances of the chalk class would be objects.

Consequences of object-oriented programming


Last modified: Mon Jun 26 22:03:04 PDT 2000