November 2001
Intermediate to advanced
512 pages
9h 10m
English
The Chain of Responsibility pattern allows a number of classes to attempt to handle a request without any of them knowing about the capabilities of the other classes. It provides a loose coupling between these classes; the only common link is the request that is passed between them. The request is passed along until one of the classes can handle it.
One example of such a chain pattern is a Help system like the one shown in Figure 22-1. This is a simple application where different kinds of help could be useful, where every screen region of an application invites you to seek help but in which there are window background areas where more generic help is the only suitable result.
Figure 22-1. A simple application ...
Read now
Unlock full access