Chain of Responsibility
Chain of Responsibility is a behavioral design pattern that lets you pass requests along a chain of handlers. Upon receiving a request, each handler decides either to process the request or to pass it to the next handler in the chain. Imagine that you’re working on an online ordering system. You want to restrict access to the system so only authenticated users can create orders. Also, users who have administrative permissions must have full access to all orders. After a bit of planning, you realized that these checks must be performed sequentially. The application can attempt to authenticate a user to the system whenever it receives a request that contains the user’s credentials. However, if those credentials aren’t correct and authentication fails, there’s no reason to proceed with any other checks. The request must pass a series of checks before the ordering system itself can handle it. During the next few months, you implemented several more of those sequential checks. One of your c
/ Design Patterns / Behavioral Patterns Chain of Responsibility Also known as: CoR, Chain of Command Intent Chain of Responsibility is a behavioral design pattern that lets you pass requests along a chain of handlers. Upon receiving a request, each handler decides either to process the request or to pass it to the next handler in the chain. Problem Imagine that you’re working on an online ordering system. You want to restrict access to the system so only authenticated users can create orders. Also, users who have administrative permissions must have full access to all orders. After a bit of pl
Explore this link on the map →related reading
- Problem solving is often a matter of cooking up an appropriate Markox chainmath.uchicago.edu
- Simple Explanation for the "Reactor Pattern" with its Applications - Stack Overflowstackoverflow.com
- Design Patternsrefactoring.guru
- Design Patternsgrantslatton.com
- The Distributed Computing Manifesto | All Things Distributedallthingsdistributed.com
- Clean Coder Blogblog.cleancoder.com
- Repeat yourself, do more than one thing, and... — programming is terribleprogrammingisterrible.com
- Reading 19: Little Languagesweb.mit.edu
- Arjun Virkarjunvirk.com
- The Coming Loop | Armin Ronacher's Thoughts and Writingslucumr.pocoo.org
- The Intent Layer | Intent Systemsintent-systems.com
- CQRSmartinfowler.com