Genericity versus inheritance reconsidered: self-reference using generics

  • Authors:
  • Ed Seidewitz

  • Affiliations:
  • NASA Goddard Space Flight Center, Code 552.3, Greenbelt MD

  • Venue:
  • OOPSLA '94 Proceedings of the ninth annual conference on Object-oriented programming systems, language, and applications
  • Year:
  • 1994

Quantified Score

Hi-index 0.00

Visualization

Abstract

As shown by the work of Bertrand Meyer, it is possible to simulate genericity using inheritance, but not vice-versa. This is because genericity is a parameterization mechanism with no way to deal with the polymorphic typing introduced using inheritance. Nevertheless, if we focus on the use of inheritance as an implementation technique, its key feature is the dynamic binding of self-referential operation calls. This turns out to be basically a parameterization mechanism that can in fact be simulated using generics and static binding. And for some applications this approach may actually be of more than academic interest.