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?
- A. Specification
- B. Chain of Responsibility
- C. Template Method
- 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.
Practise more Software Engineering, Git and Cloud Basics questionsSoftware Engineering, Git and Cloud Basics: notes and key points
More Software Engineering, Git and Cloud Basics questions
- A service reuses expensive database connections from a pool instead of opening one per request. One request leaves a connection inside an…
- Following Beizer's guidance for testing two nested loops, how should you start?
- A team builds a thin, working path through every layer of a new system (UI, API, queue, database) with minimal features, and keeps that…
- Using the convention that each if, else-if, for, while, case, && and || adds 1 to the count of decision points, what is the cyclomatic…
- For a 32 KLOC project, the Basic COCOMO organic-mode equation Effort = 2.4 x (KLOC)^1.05 person-months gives approximately how much effort?
- Using basic COCOMO in the organic mode (effort = 2.4 × (KLOC)^1.05 person-months), the effort for a 50 KLOC product is closest to: