next up previous contents index
Next: Instance of a class Up: Message Passing Pattern Previous: Message Passing Pattern   Contents   Start


Classes of objects

A class of objects can be considered a category to which specific objects belong. Formally speaking a class defines the attributes an object in this category must have and the services that these objects are supposed to provide. Each service an object is capable of providing can be mapped to a function defined in the class, describing exactly how the service is rendered.

In OOP terminology these functions are often called `methods' and the attributes of an object are referred to when talking about `instance variables'.

The following diagram illustrates the concept of a class as introduced above[*].

img62.gif\includegraphics[scale=0.85]{img/aplclass.eps}
As a simple example for demonstrating the features of the `sending messages' programming pattern we will use throughout this discussion a simplified handling of a bank account.

For this and the following examples we will illustrate the structure of a class and the relationship between the classes of a specific project using the diagramming technique recommended by Peter Coad in [CM97], [CN93], [CY91a] and [CY91b].

img63.gif\includegraphics[scale=0.85]{img/objex1.eps}
The rectangle above describing a class is split up into to three areas. The first area contains the name of the class, the second area lists the attributes of all objects of this class and the third area lists the methods corresponding to the service all objects of this class are capable to provide.
next up previous contents index
Next: Instance of a class Up: Message Passing Pattern Previous: Message Passing Pattern   Contents   Start


Georg P. Loczewski 2004-03-05


Impressum und Datenschutz