InterviewSolution
Saved Bookmarks
| 1. |
What is a Chain of Responsibility pattern? In what scenarios to apply this pattern? |
|
Answer» Chain of Responsibility belongs to the category of a behavioural design pattern that passes requests VIA a chain of handlers. Whenever a request is received, the handler DECIDES whether to process the request or PASS it to the next handler of the chain. It is used for achieving loose coupling where the client request is passed through an object chain to process them. The above IMAGE represents the UML diagram of this pattern. There are 3 components of this design, they are:
This pattern can be used in the following cases:
|
|