Virtual classes: a powerful mechanism in object-oriented programming

  • Authors:
  • O. L. Madsen;B. Moller-Pedersen

  • Affiliations:
  • Computer Science Department, Aarhus University, Ny Munkegade, DK-8000 Aarhus C, Denmark;Norwegian Computing Center, P.O. Box 114, Blindern, N-0314 Oslo 3, Norway

  • Venue:
  • OOPSLA '89 Conference proceedings on Object-oriented programming systems, languages and applications
  • Year:
  • 1989

Quantified Score

Hi-index 0.00

Visualization

Abstract

The notions 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.