Problem with MI - Name Ambiguity

Unfortunately, multiple inheritance is rife with subtle problems, both semantic and for the language implementer. We will discuss only some of these here.

The first problem is the potential for name ambiguity. Suppose, for example, we have a card deck that knows how to draw the topmost card out of the deck. We also have a class GraphicalItem that knows how to draw an image on a window.

If we wish to combine this, and make a deck of cards that can be represented graphically, what should be the meaning of draw?

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