5.6.5 The VOOPS Class Model



next up previous contents
Next: 6 VISTA Data Level Up: 5.6 VOOPS Previous: 5.6.4 Architecture of VOOPS

5.6.5 The VOOPS Class Model

  

VOOPS maps classes and member definitions onto C types, structures and unions. A class is translated into a structure definition, with the class members being structure members. Accessor macros are defined for each class member which allow access to class members through verbose names instead of complicated and not obviously comprehensible C structure member access and pointer dereference operators. All classes have a default object identifier member which is used to store a unique ID of the object, when it is newly created with the default New method.

Inheritance is effected through defining the members of the specified parent class in the currently defined class too. Since all these parent class members are also included as C structure members, one limitation becomes obvious: No two members can have the same name, if they appear in the same inheritance branch of the class tree, since this would produce a name conflict in the resulting C code. Fig. 5.2 shows how members and methods are inherited for the example on page gif.

On definition, a unique class name (a LISP symbol) has to be given to a class, which is used as an identifier on subsequent accesses to the class. An optional documentation string given in the class definition is translated into a documentation comment conforming to the VISTA documentation guidelines (see [IuE94]). Besides the documentation string, members can also have alias names which are aliased via a C macro to the original member accessor macro.

A detailed description of the VOOPS implementation, its syntax and a simple example demonstrating some of VOOPS' object-oriented features may be found in Appendix C.



Martin Stiftinger
Tue Nov 29 19:41:50 MET 1994