Design Patterns · Middle · Question 74 of 75
Why is the Chain of Responsibility pattern a good fit for validation rules?
- ✓Correct answer: Each rule checks one thing and passes control on; rules can be added, removed or reordered independently
- 2It guarantees all rules run in parallel
- 3It removes the need for error messages
Explanation
The same idea powers middleware stacks; keep each handler focused and the order explicit.