Exploring Multiple Inheritance
This chapter will continue broadening our knowledge of object-oriented programming in C++. We will begin by examining a controversial OO concept, multiple inheritance (MI), understanding why it is controversial, how it can reasonably be used to support OO designs, as well as when alternative designs may be more appropriate.
Multiple inheritance can be implemented in C++ with direct language support. In doing so, we will be faced with several OO design issues. We will be asked to critically evaluate an inheritance hierarchy, asking ourselves whether we are using the best design possible to represent a potential set of object relationships. Multiple inheritance can be a powerful OOP tool; using it wisely is paramount. We will learn when to use MI to sensibly extend our hierarchies.
In this chapter, we will cover the following main topics:
- Understanding multiple inheritance mechanics
- Examining reasonable uses for multiple inheritance ...