e Key Concepts of Object Orientation


Key Concepts of Object-Orientation

The Idea

Object-orientation provides an approach to building computer models, in which real-world entities, such as:

are represented by objects. Each individual `bank account' is represented by a unique object in the system.

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.


A giant leap for programmers, but a small step for mankind...

The object-oriented idea is somewhat of a revolution for programmers, but for "the rest of us" this idea is really quite natural.

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.


How is an object-oriented system structured?

The objects in an object-oriented system have relations to each other, which represent real-world relations: a Bank Account is associated with a Bank Customer, while a Customer may be associated with many Bank Accounts. This structure is often illustrated using graphical object-model diagrams.

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.


Just as we humans see relations among categories and more specialised sub-categories, we may in object-oriented systems define inheritance relationsships between classes and subclasses, to model generalization (e.g. Bank Customers) and specialisation (e.g. Private Bank Customers and Corporate Bank Customers).

Another key concept of object orientation is polymorphism.


Source: "Objektorientering - en guide for nyfikna", "Ung Forskning", no 4, 1994 written by Lennart Månsson.


previous | next | start | contents | dictionary | help | evaluation

© Ericsson Telecom AB, 1995, Stockholm, Sweden