Introduction to OOP: Chapter 7: Inheritance
Idealized Image of Inheritance
Consider the following argument:
- Instances of the subclass must possess all data areas associated with
the parent class.
- Instances of the subclass must implement, through inheritance at least
(if not explicitly overridden) all functionality defined for the parent
class. (They can also define new functionality, but that is unimportant
for the present argument).
- Thus, an instance of a child class can mimic the behavior of the parent
class and should be indistinguishable from an instance of the parent
class if substituted in a similar situation.
Intro OOP, Chapter 7, Slide 6
The principle of substitutability is sometimes called Liskov
substitutability, since one of the first people to describe the idea
was Barbara Liskov, of MIT.