Specification Pattern

Encapsulate business rules as reusable objects

Overview

The Specification pattern encapsulates a business rule into a single, reusable object. These specifications can often be chained together using logical AND, OR, and NOT operations.

Code Example

java
1public interface Specification<T> { boolean isSatisfiedBy(T item); }

AI Tutor

Ask about the topic

Sign in Required

Please sign in to use the AI tutor

Sign In
Specification Pattern - Additional Patterns | LLD | Revise Algo