Representation Inheritance: A Safe Form of "White Box'' Code Inheritance

There are two approaches to using code inheritance for defining new component implementations in terms of existing implementations. Black box code inheritance allows subclasses to reuse superclass implementations as-is, without direct access to their internals. Alternatively, white box code inheritance allows subclasses to have direct access to superclass implementation details, which may be necessary for the efficiency of some subclass operations and to prevent unnecessary duplication of code. Unfortunately, white box code inheritance violates the protection that encapsulation affords superclasses, opening up the possibility of a subclass interfering with the correct operation of its superclass methods. Representation inheritance is proposed as a restricted form of white box code inheritance where subclasses have direct access to superclass implementation details, but are required to respect the representation invariant(s) and abstraction relation(s) of their ancestor(s). This preserves the protection that encapsulation provides, while allowing the freedom of access that component implementers sometimes desire.

[1]  Kevin Lano,et al.  Object-oriented specification case studies , 1994 .

[2]  Bruce W. Weide,et al.  Part III: implementing components in RESOLVE , 1994, SOEN.

[3]  V. Stavridou,et al.  Abstraction and specification in program development , 1988 .

[4]  Bertrand Meyer,et al.  Reusable Software: The Base Object-Oriented Component Libraries , 1994 .

[5]  Martín Abadi,et al.  Methods as Assertions , 1994, Theory Pract. Object Syst..

[6]  Jeannette M. Wing,et al.  A behavioral notion of subtyping , 1994, TOPL.

[7]  Wilf R. LaLonde Designing families of data types using exemplars , 1989, TOPL.

[8]  Jeannette M. Wing,et al.  A New Definition of the Subtype Relation , 1993, ECOOP.

[9]  Joseph Eugene Hollingsworth Software component design-for-reuse: a language-independent discipline applied to ADA , 1992 .

[10]  Bruce Weide,et al.  Component-based software using RESOLVE , 1994, SOEN.

[11]  Gail E. Kaiser,et al.  Adequate testing and object-oriented programming , 1990 .

[12]  Murali Sitaraman,et al.  Special feature: component-based software using resolve , 1994 .

[13]  簡聰富,et al.  物件導向軟體之架構(Object-Oriented Software Construction)探討 , 1989 .

[14]  John Lamping,et al.  Typing the specialization interface , 1993, OOPSLA '93.

[15]  Lonnie R. Welch,et al.  On Specification of Reusable Software Components , 1993, Int. J. Softw. Eng. Knowl. Eng..

[16]  Raymie Stata,et al.  Modular reasoning in the presence of subclassing , 1995, OOPSLA.

[17]  T LeavensGary,et al.  Specification and verification of object-oriented programs using supertype abstraction , 1995 .

[18]  Stephen Edwards,et al.  An Approach for Constructing Reusable Software Components in Ada , 1990 .

[19]  Jeannette M. Wing A specifier's introduction to formal methods , 1990, Computer.