next up previous contents index
Next: GRAPE Up: Object-Oriented Programming Previous: Sequential Versus Object-Oriented Programming

Classes, Instances and Methods

 

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.


next up previous contents index
Next: GRAPE Up: Object-Oriented Programming Previous: Sequential Versus Object-Oriented Programming

SFB 256 Universität Bonn and IAM Universität Freiburg

Copyright © by the Sonderforschungsbereich 256 at the Institut für Angewandte Mathematik, Universität Bonn.