Virtual Classes - a powerful mechanism in object-oriented programming

Authors

  • Ole Lehrmann Madsen
  • Birger Møller-Pedersen

DOI:

https://doi.org/10.7146/dpb.v18i283.6660

Abstract

The notations of class, subclass and virtual procedure are fairly well understood and recognized as some of the key concepts in object-oriented programming. The possibility of modifying a virtual procedure in a subclass is a powerful technique for specializing the general properties of the superclass.

In most object-oriented languages, the attributes of an object may be references to objects and (virtual) procedures. In Simula and BETA it is also possible to have class attributes. The power of class attributes has not yet been widely recognized. In BETA a class may also have virtual class attributes. This makes it possible to defer part of the specification of a class attribute to a subclass. In this sense virtual classes are analogous to virtual procedures. Virtual classes are mainly interesting within strongly typed languages where they provide a mechanism for defining general parameterized classes such as set, vector and list. In this sense they provide an alternative to generics. Although the notion of virtual class originates from BETA, it is presented as a general language mechanism.

Author Biographies

Ole Lehrmann Madsen

Birger Møller-Pedersen

Downloads

Published

1989-08-01

How to Cite

Madsen, O. L., & Møller-Pedersen, B. (1989). Virtual Classes - a powerful mechanism in object-oriented programming. DAIMI Report Series, 18(283). https://doi.org/10.7146/dpb.v18i283.6660