Graph interpretation of methods: a unifying framework for polymorphism in object-oriented programming

  • Authors:
  • Injun Choi;Michael V. Mannino

  • Affiliations:
  • -;-

  • Venue:
  • ACM SIGPLAN OOPS Messenger
  • Year:
  • 1991

Quantified Score

Hi-index 0.00

Visualization

Abstract

We discuss two interpretations of methods and classes in object-oriented programming and demonstrate a type system based on the notion of methods as graphs. Definitionally, a class may be viewed as a data structure associated with either a collection of method interfaces or a collection of individual methods. In the former interpretation, a method represents a collection of functions that satisfy its interface known as a function space. In the latter interpretation, a method represents a set of input-output pairs of a specific function, called the function's graph. We informally describe and contrast these interpretations with particular emphasis on subtyping rules for methods --- an anti-monotonic rule for the function space interpretation and a monotonic rule for the graph interpretation. These rules have practical implications on type checking, method redefinition, assertions, dynamic binding, and completeness of subtype testing. We present a notation based on the latter interpretation and demonstrate several interesting features of our notation including abstract data types for encapsulation, four kinds of ad-hoc polymorphism (disjoint overloading, coercion, incremental overloading, and specialization), and type restrictions to precisely define the relationship among arguments in polymorphic methods.