HANA: A Model of Type and Inheritance for Object-Oriented Programming Languages
Lee, Keung Hae
Kafura, Dennis G.
MetadataShow full item record
Most current object-oriented languages consider inheritance as subtyping. However, a type system which views inheritance as subtyping allows neither multiple representations of a type nor method exclusion without violating typing constraints. These problems and the difference between inheritance and subtyping have been well recognized recently. Another approach to subtyping found in the literature is to separate inheritance from subtyping. In this approach, subtyping is solely determined by inheritance conformance. While subtyping based on interface conformance can support multiple representations, it cannot distinguish intended conformance from accidental conformance. This paper describes a new model of type and inheritance, called HANA, in which subtyping and inheritance are not separated, although differentiated. The notion of subtyping in HANA is based on both inheritance and interface conformance. HANA integrates multiple inheritance multiple representations, method exclusion, and method name overloading with static typing. HANA extends other existing methods of inheritance and subtyping with enhanced expressive power, increased reusability, and program efficiency. We show that the differentiation made by HANA between inheritance and subtyping allows name collision to be resolved without compromising the integrity of the type system. The capability of excluding an inherited method without violating static typing offers a sound solution for resolving name collision in multiple inheritance when used together with other mechanisms. We show that the mechanisms of method exclusion, addition, and renaming are othogonal with respect to the power of resolving name collision in multiple inheritance.