Supporting inheritance using subclass assertions

作者:

Highlights:

摘要

Inheritance, together with object and class, is the key concept of object oriented systems. Adopting the concept-oriented view (COV for short) of inheritance, current OO systems such as GemStone, Orion, C++, O2, PostGres, Iris, and SmallTalk dominantly interpret inheritance by retaining all attributes and methods in a subclass from its superclass, and by supporting the specification of additional attributes and methods in the subclass. However, this monotonic extension property may result in a redundant subclass representation which in turn gives rise to update anomalies. Thus extra effort in practice used to prevent these problems from happening is to change an IS-A relationship in COV of hierarchy into sibling in the program-oriented view (POV for short) hierarchy. However, the dichotomy between the concept and implementation leads to a significant difference of the class hierarchy between the designing phase and implementation phase of OO systems, hence increases the complexity in designing OO systems. In this paper, we show that, when the subclass attributes are linearly related to the superclass attributes (the attributes in the superclass can be linearly expressed by those in the subclass), linear subclass assertions/constraints can be elegantly used to resolve the problems such as the redundant subclass representation, and update anomalies. We have proved that (1) given a linear subclass assertion, a non-redundant subclass representation can be automatically decided, and the bilateral mappings between the class and the determined subclass can be automatically constructed, and (2) given a user-chosen subclass representation and the mapping from the chosen subclass to the superclass, the linear subclass assertion and inverse mapping can be automatically constructed, and (3) placing an object into the most specific class in an ISA class hierarchy can be automatically conducted. The proposed novel ideas have been prototyped on GemStone/Smalltalk on a SunSparc/Unix platform. Our experience indicates that the proposed idea can be efficiently and effectively integrated into an OO system.

论文关键词:Objects,Object-Oriented Design,Object-Oriented Programming,Subclass Assertion,Inheritance

论文评审过程:Received 8 December 1994, Revised 14 October 1995, Available online 19 January 2000.

论文官网地址:https://doi.org/10.1016/0306-4379(95)00036-4