Chapter 11: Object-Oriented Design
11.1 Introduction
The first nine chapters of the book discussed how to structure the objects in a problem, and Chapter 10 addressed how to organize the relationships between objects for utility objects. The discussion in Chapter 10 suggested that composition should always be preferred over classification when designing and constructing utility objects; however, most objects used in a program are not utility objects but represent parts of the problem definition. When the objects are part of the problem definition, should composition or classification be used when constructing an object?
The choice of composition or classification can normally be determined by answering the question, “Is the relationship between ...
Get Creating Components 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.