Design Patterns · Middle · Question 56 of 75
What does the Specification pattern give you for complex filters?
const isEligible = and(isActive, or(isPremium, hasOrdersOver(3)));- ✓Correct answer: Small, named predicates that can be combined (and/or/not) and reused for filtering or validation
- 2A database schema
- 3A formal API specification document
Explanation
Business rules become readable building blocks instead of one long condition copied in several places.