System Design
15. Software Design PatternsAnimated walkthrough
Specification Pattern
Reusable business rules as objects.
The idea
Each rule is a specification that can be combined with and, or and not.
Watch it work
The steps light up one at a time. Use the controls to pause or step through.
- 1Create a specification
- 2Combine specifications
- 3Test an object against it
- 4Reuse for queries
1/4
Step by step
- 1Create a specification
- 2Combine specifications
- 3Test an object against it
- 4Reuse for queries
Where it is used
Complex filtering rules.
Watch out for
Can be over-engineered.