e
In the traditional approach to building computer models, data and instructions are structured independently of each other.
In the object-oriented approach, each object keeps the data which describes the object (e.g. registration number and colour for an individual car), and also contains all the instructions to manipulate the data which it stores.
The object is said to be encapsulated, i.e. no other object can access its internal parts. Instead the object offers a set of operations in the system, which other objects may invoke. These operations model the behaviour of the object in the real world.
Let us say for example that someone wants to know the turn-over of a company. He or she might call the economist at the company, and ask for this information, thereby using one of the "operations" which the economist offers, while remaining completely ignorant about how the economist obtains the answer.
An object-oriented system is characterized by the same kind of distributed allocation of responsibilities, since the structure of the information stored, and how it is processed is only known locally within an object.
It is encapsulation and distributed allocation of responsibilities which are the keys to achieving modifiable software. Changes to the software can often be kept local to individual objects, and need not affect the structure of the system.
Another aspect of how the object-oriented idea resembles the human way of organising information is categorisation. We humans categorise things (Cars, Bank Accounts and Nodes), and store information about these categories, instead of the unique items.
In the object-oriented world, these categories are represented by classes, where a class is a description of the common properties of a category of objects.
Object-oriented programming in languages like C++ and Smalltalk is basically about defining classes, rather than defining the individual objects. The classes are considerably fewer in a typical system, perhaps a couple of hundred classes, compared to thousands of objects.
Another key concept of object orientation is polymorphism.
© Ericsson Telecom AB, 1995, Stockholm, Sweden