This article describes the Specification design pattern. This is a
behavioral design pattern, a category of
design pattern used by software engineers, when writing computer programs.
This article describes the Specification design pattern. This is a
behavioral design pattern, a category of
design pattern used by software engineers, when writing computer programs.
The Specification pattern is a
design pattern, used in software engineering to simplify interfaces and decouple classes. Rather than having a number of methods for retrieving information under specific conditions, the class simply has a GetBySpecification
method which takes the conditions (specification) as a parameter. The specifications are a class themselves that has a IsSatisfiedBy method, which determines which items are returned, based on the specifications.
It is defined as a
behavioral design pattern, because the returned data and resulting actions are dependant on the specifications.
This pattern helps to decouple classes, because methods are simplified to a generic call, which does not need to know the conditions.
[please contribute]