The following class diagram describes the structure and the actors of the chain-of-responsibility pattern:
The following classes are involved in the preceding diagram:
- Client: This is the main structure of the application that uses the pattern. It's responsible for instantiating a chain of handlers and then for invoking the handleRequest method on the first object.
- Handler: This is the abstract class from which all the concrete handlers have to be inherited. It has a handleRequest method, which receives the request that should be processed.
- ConcreteHandlers: These are the concrete classes which implement a handleRequest method ...