Chain of Responsibility without Composite

CHAIN OF RESPONSIBILITY requires a strategy for ordering the search for an object that can handle a request. Usually, the order to follow will depend on an underlying aspect in the modeled domain. This frequently occurs when there is composition, as in the Oozinoz machine hierarchy. However, this pattern can apply outside object models that are composites.

CHALLENGE 12.5Cite an example when the CHAIN OF RESPONSIBILITY pattern might occur if the chained objects do not form a composite.

Get Design Patterns Java™ Workbook 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.