Summary
In this chapter, we have marched onward with our quest for understanding object-oriented programming by exploring a controversial OOP topic, that of multiple inheritance. First, in this chapter, we have understood the simple mechanics of multiple inheritance. Equally important, we have reviewed reasons for building inheritance hierarchies and possible reasons for using MI (that is, specifying Is-A, mix-in, and Has-A relationships). We have been reminded that using inheritance to specify Is-A relationships supports pure OO designs. We have also seen the utility of using MI to implement mix-in relationships. We have also taken a look at the controversial use of MI to quickly implement a Has-A relationship; we’ll see in Chapter 10, Implementing Association, Aggregation, and Composition, a preferred implementation for Has-A.
We have seen how having multiple inheritance in our OO design toolkit can lead to diamond-shaped hierarchies. We have seen the inevitable issues...