Virtual Classes and Their Implementation

  • Authors:
  • Ole Lehrmann Madsen

  • Affiliations:
  • -

  • Venue:
  • CC '01 Proceedings of the 10th International Conference on Compiler Construction
  • Year:
  • 2001

Quantified Score

Hi-index 0.00

Visualization

Abstract

One of the characteristics of BETA [4] is the unification of abstraction mechanisms such as class, procedure, process type, generic class, interface, etc. into one abstraction mechanism: the pattern. In addition to keeping the language small, the unification has given a systematic treatment of all abstraction mechanisms and leads to a number of new possibilities. One of the interesting results of the unification is the notion of virtual class [7,8], which is the BETA mechanism for expressing genericity. A class may define an attribute in the form of a virtual class just as a class may define an attribute in the form of a virtual procedure. A subclass may then refine the definition of the virtual class attribute into a more specialized class. This is very much in the same way as a virtual procedure can be refined - resulting in a more specialized procedure. Virtual classes can be seen as an object-oriented version of generics. Other attempts to provide genericity for OO languages has been based on various forms of parametric polymorphism and function application rather than inheritance. Virtual classes have been used for more than 15 years in the BETA community and they have demonstrated their usefulness as a powerful abstraction mechanism. There has recently been an increasing interest in virtual classes and a number of proposals for adding virtual classes to other languages, extending virtual classes, and unifying virtual classes and parameterized classes have been made [1, 2, 3, 13, 14, 15, 16, 17].