Using accessory functions to generalize dynamic dispatch in single-dispatch object-oriented languages

  • Authors:
  • David Wonnacott

  • Affiliations:
  • Department of Computer Science, Haverford College, Haverford, PA

  • Venue:
  • COOTS'01 Proceedings of the 6th conference on USENIX Conference on Object-Oriented Technologies and Systems - Volume 6
  • Year:
  • 2001

Quantified Score

Hi-index 0.00

Visualization

Abstract

Object oriented languages generally include some form of dynamic dispatch; that is, in the absence of precise compile-time type information, they perform a run-time selection of the appropriate function body (or method) from a set of candidates. Existing single-dispatch languages restrict dynamic dispatch to the object receiving the message. Such languages exhibit a conflict between the goals of providing an extensible a set of types and providing an extensible the set of operations that can be performed on these types. We show that this conflict is a consequence of the restriction of dynamic dispatch to the receiver object. We also demonstrate that this conflict can be resolved by introducing a generalized form of single dispatch (thus avoiding the complexity of multiple dispatch). On this evidence, we argue that dispatch technique should be decoupled from membership in a class and access to its representation.