Applied Design Patterns with Java

Behavioral :: Chain of Responsibility (223) {C ch 16}

Examples - UML : Chainer and HelpChain




The first example Java program is called 'Chainer'.

The UML diagram is above, and the list of Java files is below:



The second example Java program is called 'HelpChain'.




The UML diagram is above, and the list of Java files is below:


Example - Java :: Patterns\Behavioral\Chain of Responsibility

Pattern Concept: to allow a number of classes to attempt to handle a request, without any class knowing of the capabilities of the other classes. The core idea is 'Loose Coupling' in the interactions; the classes can only forward the request along a common chain.

Issues of the Chain of Responsibility pattern include:



A
Chain of Responsibility can be implemented in a Tree instead of a Linear List. The advantage of a Tree is that searches are faster; however, the structure itself is more complex than a Linear List.

Catalog Behavioral Prev Next