Summary of Forms of Inheritance

We can summarize the various different types of inheritance as follows.

In subclassing for Specialization the child class is a special case of the parent class; in other words, the child class is a subtype of the parent class.

In subclassing for specification, the parent class defines behavior that is implemented in the child class but not in the parent class.

In subclassing for construction, the child class makes use of the behavior provided by the parent class, but is not a subtype of the parent class.

In subclassing for generalization, the child class modifies or overrides some of the methods of the parent class.

In subclassing for extension, the child class adds new functionality to the parent class, but does not change any inherited behavior.

In subclassing for limitation, the child class restricts the use of some of the behavior inherited from the parent class.

In subclassing for variance, the child class and parent class are variants of each other, and the class-subclass relationship is arbitrary.

In subclassing for combination, the child class inherits features from more than one parent class. This is multiple inheritance and will be the subject of a later chapter.

[audio] [real] Text to accompany slide15, in Chapter 7 of An Introduction to Object-Oriented Programming