Tuesday, 19 April 2016

Chain of Responsibility - Behavioral


  • Let more than one object handle a request without knowing each other
  • Pass the request to chained objects until it has been handled
  • Avoids attaching the sender of a request to its receiver
  • Giving other objects the possibility of handling the request too
  • The objects become parts of a chain and the request is sent from one object to another across the chain until one of the objects will handle it.



Where to use ?
  • One request should be handled by more than one object
  • Don't know which object should handle a request, probably more than one object will handle it automatically
  • Reduce coupling
  • Flexible in handling a request

No comments:

Post a Comment

Note: only a member of this blog may post a comment.