Summary

In this chapter, we compared the use of inheritance with other programming techniques, such as aggregation and a general relationship among classes.

I tried to stress the viability of other alternatives because I feel that in general inheritance is used too much. Yes, the job of the server class designer is simpler with the use of inheritance. Formally, the task of the client designer is not more difficult. But it is not more difficult only in the sense of writing code, and this is only a small part of what we do when implementing a program. The use of inheritance forces the client programmer to learn more about the server design than is necessary, especially if the inheritance hierarchy is tall and bushy.

We also looked into examples ...

Get Core C++ A Software Engineering Approach 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.