Introduction to OOP Chapter 8: Inheritance and Substitution: next previous audio real text

Inheritance for Limitation

If a child class overrides a method inherited from the parent in a way that makes it unusable (for example, issues an error message), then we call it inheritance for limitation.

For example, you have an existing List data type that allows items to be inserted at either end, and you override methods allowing insertion at one end in order to create a Stack.

Generally not a good idea, since it breaks the idea of substitution. But again, it is sometimes found in practice.

Intro OOP, Chapter 8, Slide 20