chain of responsibility

Chain of responsibility is used to achieve loose coupling where a request from the sender is passed to a chain of receivers to process them. Later, the receivers in the chain will decide by themselves who will be processing the request and whether the request is required to be sent to the next receiver in the chain or not.
Where and When Chain of Responsibility pattern is applicable : 
* When you want to decouple a request’s sender and receiver
* Multiple receivers, determined at runtime, are candidates to handle a request
* When you don’t want to specify handlers explicitly in your code
* When you want to issue a request to one of several receivers without specifying the receivers explicitly.

This pattern is recommended when multiple receivers can handle a request and the handler doesn’t have to be a specific receiver. Also, the handler is determined at runtime. Please note that a request not handled at all by any receiver is a valid use case.