Chapter 14. Choosing between Inheritance and Composition

Topics in this Chapter

In this chapter, you will see more examples of inheritance and composition. I will start with a smaller example and compare the use of inheritance with other programming techniques.

I am going to compare different design alternatives for implementing the same program. "Design" here means the same as it has in the rest of the book: deciding what parts (classes) the program should consist of and what responsibilities (data members and member functions) should be assigned to each part. In comparing different design ...

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.