The key to the Behavioral patterns is the allocation of responsibilities through either
inheritance or object composition. First, only theTemplatedesign pattern in this sec-
tion actually distributes responsibilities through inheritance. It’s a simple pattern
using an abstract class for the general outline of an algorithm, with the subclasses
taking up the more detailed aspects. Second, and far more common among Behav-
ioral patterns, is the use of object composition to allocate and distribute responsibili-
ties. TheCommand,Observer,StateandStrategypatterns all employ the object
composition for distribution of tasks among the patterns classes and objects.
Chapter 7,Command Pattern
Chapter 8,Observer Pattern
Chapter 9,Template Method Pattern
Chapter 10,State Pattern
Chapter 11,Strategy Pattern
Figure Part IV-1. Behavioral patterns allocate responsibilities
Class
Behavioral Patterns
Class
Responsibility Responsibility Responsibility
Responsibility Responsibility Responsibility
Communication