The classes are sorted hierarchically in a tree. Each class corresponds to one of the tree's nodes. A subclass is represented by a child's node and the parent's node is the superclass. The root of this tree is a class whose instances have only a basic structure. Every subclass is defined by its superclass attributes extended by further properties. In general this is an extended data structure with new and advanced methods.
The classes may have instances, which represent the same class data structure at different states, e.g. several graphic objects of different type. Likewise each instance belongs to one class, which defines its structure. The structure is made of variables called instance variables. These variables define exactly one state of this object. The application of methods affects only the instance variables, e.g. a method modifies a graphic object by updating the corresponding instance variable according to the parameters.
The hierarchy of the class structure is guaranteed by integrating the instance variables of the superclass. This means that an instance of a class consists of the instance variables of the superclass and the additional instance variables of the class.
In an object-oriented programming environment the execution of any object method is implemented by passing a message, which contains the method name and the necessary parameters. This message invokes searching for the appropriate method in the class' list of methods. If a suitable method is found, it is executed.
Remembering the last paragraph about instances it is possible to apply a method to the subclasses instances, because they have at least the same variables. In fact this feature is the most important abstraction in object-oriented programming. If an object receives a message and the appropriate method is not found, the method name is searched in the list of the corresponding superclasses methods. These methods can be applied, because the hierarchy of the class structure is guaranteed. This is the way subclasses inherit their superclasses methods. Moreover the superclasses methods can be called directly.
Since a method's application is set up by ``message passing'' and the correct method is chosen according to the object class during runtime another interesting feature has to be mentioned. If a class instance has a variable pointing to another object, the actual method can send a message to this object. It is not necessary to care about the object class during implementation, because the corresponding method is found automatically. This means that a method name is identified with a function during runtime (late binding). Moreover the applied function depends on the corresponding class of the object. Therefore different methods may have the same name in different classes, e.g. different methods are needed to display different objects, but they all have the same name ``display''.
Copyright © by the Sonderforschungsbereich 256 at the Institut für Angewandte Mathematik, Universität Bonn.