Specification pattern: Difference between revisions

Content deleted Content added
clean up, typo(s) fixed: Furthermore → Furthermore, using AWB
Line 2:
In computer programming, the '''specification pattern''' is a particular [[software design pattern]], whereby [[business rules]] can be recombined by chaining the business rules together using boolean logic. The pattern is frequently used in the context of [[___domain-driven design]].
 
A specification pattern outlines a business rule that is combinable with other business rules. In this pattern, a unit of business logic inherits its functionality from the abstract aggregate Composite Specification class. The Composite Specification class has one function called IsSatisfiedBy that returns a boolean value. After instantiation, the specification is "chained" with other specifications, making new specifications easily maintainable, yet highly customizable business logic. Furthermore, upon instantiation the business logic may, through method invocation or [[inversion of control]], have its state altered in order to become a delegate of other classes such as a persistence repository.
 
== Code examples ==
 
=== [[C Sharp (programming language)|C#]] ===
 
Line 328 ⟶ 329:
* [https://github.com/neoneye/SpecificationPattern The Specification Pattern in Swift] by Simon Strandgaard
* [https://web.archive.org/20110724151447/http://www.dpdk.nl/opensource/specification-pattern-for-selection-on-lists specification pattern in flash actionscript 3] by Rolf Vreijdenberger
 
 
{{Design Patterns Patterns}}