Idealization of is-a Relationship

In earlier chapters, we have briefly discussed polymorphism and the is-a relationship. Our idealization of this relationship went something like the following.

Imagine a class TextWindow that inherits from a parent class Window. We say that a TextWindow is-a Window. Because it is formed using subclassing, all behavior that we expect from class Window will also be manifest by an instance of TextWindow.

Therefore, a variable declared as maintaining an instance of Window should also be able to hold a value of type TextWindow.

Unfortunately, more practical programming language implementation issues will complicate this idealized picture.

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