Map
Index
Random
Help
Topics
th

Topic: inheritance of properties

topics > computer science > programming > object-oriented programming > Group: type inheritance



Topic:
abstraction by common attributes
Topic:
classification
Topic:
inheritance by delegation
Topic:
opaque and partially-opaque data types
Topic:
type hierarchy
Topic:
type inheritance as reuse
Topic:
types of object-oriented classes

Summary

A class may inherit the properties of its superclass. This is called representation or white box inheritance. It comes in two forms. Class inheritance copies or embeds the properties in the new class. Delegation inheritance retains the properties with the superclass.

Inheritance of properties is similar to hierarchical classification. The subclass has the characteristics of the superclass as well as differentiata of its own.

Need a representation invariant to prove that the inheritance of properties is valid. It complicates retesting a class after a new subclass. (cbb 3/01)

Subtopic: properties up

Quote: a CLR property is a named value and its methods; typically a getter method and an optional setter method [»hamiJ2_2003]

Subtopic: shared vs. embedded inheritance -- delegation up

Quote: inheritance of state allows a parent to share or duplicate its variables with its descendents [»taivA9_1996]
Quote: inheritance by delegation allows changes to a parent node to automatically apply to descendants [»taivA9_1996]
Quote: implement inheritance by delegation or by concatenation; i.e., use reference to share an interface, or use contiguity to copy an interface [»taivA9_1996]
Quote: delegation inheritance shares attributes while embedding inheritance copies attributes; can distinguish in object-based languages but not class-based languages [»abadM_1996]

Subtopic: inheritance vs. attribute up

Note: 'Men are mortal' subordinates the concept 'men' to the concept 'mortal'; not an attribute

Subtopic: inheritance of state -- concatenation up

Quote: in class-based systems, a class inherits the structure of the parent but not its contents or state

Subtopic: static vs. dynamic inheritance -- modes up

Quote: modify the behavior of an object with traits, dynamic inheritance, or modes; e.g., distinguish open and iconified windows [»taivA9_1996]

Subtopic: partially opaque type up

Quote: the partially opaque type reveals some of an object's fields in its interface; e.g., used for I/O streams [»nelsG_1991]

Subtopic: examples up

Quote: SUIT uses property lists to store information about an object; also searches the object's class and a global property list [»pausR10_1992]
Quote: SUIT property editor displays object, class and global property lists; drag-and-drop; makes it easy to learn state inheritance [»pausR10_1992]
Quote: for locating properties of composite objects, SUIT checks the composition tree without checking their class properties [»pausR10_1992]
Quote: Self parent slots are marked by '*' and searched if message not found

Subtopic: selective inheritance -- mixin up

Quote: selective inheritance blurs the distinction between parents and methods; i.e., a descendant can use a subset of a parent's identifiers as its own [»taivA9_1996]
Quote: a mixin class implements properties solely for use in other classes; create a new class by combining mixins [»taivA9_1996]

Subtopic: representation inheritance up

Quote: representation inheritance is white-box inheritance that conforms to representation invariants and abstraction relations [»edwaSH2_1997]
Quote: use representation inheritance for efficient implementation of new operations; e.g., swap the tails of two lists without cross links or missed elements [»edwaSH2_1997]
Quote: every class should include a method to test its representation invariant; use to test and stress test representation inheritance [»edwaSH2_1997]
Quote: most object-oriented languages allow subclasses to use implementation details of a superclass; limited encapsulation [»liskB_1996]

Subtopic: white box vs. representation inheritance up

Quote: with white box inheritance, need to retest all inherited methods and all superclasses [»edwaSH2_1997]
Quote: with representation inheritance, do not need to retest the superclass; as long as its representation invariant and abstraction relation are correctly maintained

Subtopic: limitations of inheritance up

Quote: while dogs inherit characteristics from mammals, the definition of mammals is partly from dogs [»coxBJ7_1983]
Quote: the is-a relation does not hold for particular instances of squares and rectangles; e.g. a rectangle of height 5 and width 20 [»winkJF8_1992]
Quote: with cancellation, Clyde the elephant could be just about anything, including a giraffe; the Elephant node is just a collection of properties
[»bracRJ10_1983]

Related Topics up

Topic: abstraction by common attributes (19 items)
Topic: classification (65 items)
Topic: inheritance by delegation (8 items)
Topic: opaque and partially-opaque data types (14 items)
Topic: type hierarchy (18 items)
Topic: type inheritance as reuse (27 items)
Topic: types of object-oriented classes
(18 items)

Updated barberCB 7/04
Copyright © 2002-2008 by C. Bradford Barber. All rights reserved.
Thesa is a trademark of C. Bradford Barber.