Basically a summary of what have been said about OO design
Item 43: Use Multiple Inheritance Judiciously
The deadly diamond shape inheritance relationship.
That’s why Java uses multiple interface instead.
Item 42: Use Private Inheritance Judiciously
To inherit the implementation but not the interface.
Example:
Item 41: Differentiate Between Inheritance and Templates
A template
should be used to generate a collection of classes when the type of the objects does not affect the behavior of the class’s functions.
Item 40: Model ‘Has-a’ or ‘Is-implemented-in-terms-of’ Through Layering
Layering is known as composition, containment, and embedding.
It represents a ‘has-a’ relationship