Chain of Responsibility Pattern
Chain of Responsibility pattern is a behavioral pattern used to achieve loose coupling in software design.
In this pattern, an object is passed to a Successor, and depending on some kind of logic, will or won’t be passed onto another successor and processed. There can be any number of different successors and successors can be re-processed recursively.
This process of passing objects through multiple successors is called a chain.
The object that is passed between each successor does not know about which successor will handle…