CS FundamentalsHardProduct-company placement

Business rules like 'premium customer AND (order > ₹10,000 OR festive season)' are built as small objects with isSatisfiedBy(candidate) that can be combined with and(), or() and not(). Which pattern is this?

  1. A. Specification
  2. B. Chain of Responsibility
  3. C. Template Method
  4. D. Memento

Correct answer: A. Specification

The Specification pattern packages a business rule as an object that can be combined into composite rules and reused for validation, selection and queries. Chain of Responsibility passes a request along handlers until one handles it.

More Software Engineering, Git and Cloud Basics questions

Exams that ask this topic