Graph interpretation of methods
- 1 January 1991
- journal article
- Published by Association for Computing Machinery (ACM) in ACM SIGPLAN OOPS Messenger
- Vol. 2 (1) , 38-54
- https://doi.org/10.1145/122438.122441
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.Keywords
This publication has 8 references indexed in Scilit:
- The object-oriented functional data languageIEEE Transactions on Software Engineering, 1990
- Interfaces for strongly-typed object-oriented programmingPublished by Association for Computing Machinery (ACM) ,1989
- A denotational semantics of inheritance and its correctnessPublished by Association for Computing Machinery (ACM) ,1989
- How to make ad-hoc polymorphism less ad hocPublished by Association for Computing Machinery (ACM) ,1989
- Distributed files for SAAIBM Systems Journal, 1988
- CommonLoops: merging Lisp and object-oriented programmingACM SIGPLAN Notices, 1986
- On understanding types, data abstraction, and polymorphismACM Computing Surveys, 1985
- An ideal model for recursive polymorphic typesPublished by Association for Computing Machinery (ACM) ,1984