9.7 Designing with Composition vs. Inheritance

There’s much discussion in the software engineering community about the relative merits of composition and inheritance. Each has its own place, but inheritance is often overused and composition is more appropriate in many cases. A mix of composition and inheritance often is a reasonable design approach, as you’ll see in Exercise 9.16.1

Get Java How To Program, Late Objects, 11th Edition 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.