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
related reading
- Design Patternsrefactoring.guru
- Design Patternsgrantslatton.com
- Clean Coder Blogblog.cleancoder.com
- SOLID Design Principles Explained: Building Better Software Architecture | DigitalOceandigitalocean.com
- Abstract Factoryrefactoring.guru
- Tao of React - Software Design, Architecture & Best Practices | Alex Kondovalexkondov.com
- Chain Replication for Supporting High Throughput and Availabilitycs.cornell.edu
- Circuit Breaker Pattern (Design Patterns for Microservices)medium.com
- Simple Explanation for the "Reactor Pattern" with its Applications - Stack Overflowstackoverflow.com
- Clean Architecture: Component Cohesion Principles | by Rebeca Mora | Mediummedium.com
- Prompt Chaining | Prompt Engineering Guidepromptingguide.ai
- System Design for Beginners Courseyoutube.com