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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access