Avoid coupling the sender of a request to its receiver by giving more than one object a chance to handle the request. Chain the receiving objects and pass the request along the chain until an object handles it.
PerfectJPattern's componentized version of the Chain of Responsibility Pattern provides the following advantages:
IHandler instances may be configured with a IChainStrategy
that parameterize the Chain-continuation behavior. It was provided two concrete implementations
AllHandleStrategy and OnlyOneHandleStrategy where the later is the use-case
covered in the original GoF implementation and the default Strategy.
IHandler and IParameterlessHandler definitions: Providing both user-defined
single-parameter request types and Chain that do not require any request parameter.NullHandler implementation: that completely avoids dealing with null values as Chain stop condition.AbstractHandler and AbstractParameterlessHandler base abstract types: that only
require subtypes providing the Handler business handle(...) implementation.