7 Design subclasses right
This chapter covers
- When to use function overriding and overloading
- The Liskov Substitution Principle
- Designing classes and subclasses properly with is-a and has-a relationships
- The Favor Composition over Inheritance Principle
- Factory classes
- Using Programming by Contract correctly when designing subclasses
As described in section 1.8, inheritance is one of the main concepts of object-oriented programming. When we create an application with class hierarchies of superclasses and subclasses, we must design the subclasses right to achieve a well-designed application.
We should know when to use function overriding or ...
Get Object-Oriented Software Design in C++ now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.