[ fromfile: multiple-inheritance.xml id: multiple-inheritance ]
Multiple inheritance is a form of inheritance in which a class inherits the structure and behavior of more than one base class.
Common uses of multiple inheritance:
For combining the functionalities of different classes that have little overlap, such as in Figure 22.1.
For implementing a common "pure interface" (class with only pure virtual
functions) in a variety of different ways.
As with single inheritance, multiple inheritance defines a static relationship among classes. It cannot be changed at runtime.
Multiple inheritance hierarchies are more complex and are harder to design, implement, and understand than single inheritance hierarchies.
They can be used to solve some difficult design problems but should not not be used if a simpler approach (such as aggregation) is feasible.
Generated: 2012-03-02 | © 2012 Alan Ezust and Paul Ezust. |