Skip to content

Commit e3ef82e

Browse files
committed
Updated README.md.
1 parent fcd500d commit e3ef82e

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ Behavioral patterns are concerned with algorithms and the assignment of responsi
5757
* [Visitor](#visitor)
5858
* [Null Object](#null-object)
5959
* [Intercepting Filter](#intercepting-filter)
60+
* [Specification](#specification)
6061

6162
### Presentation Tier Patterns
6263

@@ -520,6 +521,17 @@ they store and logic they implement: data loaders, user interfaces, integration
520521
* you want to encapsulate domain logic under API
521522
* you need to implement multiple interfaces with common logic and data
522523

524+
## <a name="specification">Specification</a> [&#8593;](#list-of-design-patterns)
525+
**Intent:** Specification pattern separates the statement of how to match a candidate, from the
526+
candidate object that it is matched against. As well as its usefulness in selection, it is also valuable for
527+
validation and for building to order
528+
529+
![alt text](https://github.com/iluwatar/java-design-patterns/blob/master/specification/etc/specification.png "Specification")
530+
531+
**Applicability:** Use the Specification pattern when
532+
* You need to select a subset of objects based on some criteria, and to refresh the selection at various times
533+
* You need to check that only suitable objects are used for a certain role (validation)
534+
523535

524536

525537
# Frequently asked questions
@@ -582,6 +594,7 @@ While the implementations look similar there are differences. The Chain of Respo
582594
* [Presentation Tier Patterns](http://www.javagyan.com/tutorials/corej2eepatterns/presentation-tier-patterns)
583595
* [Functional Programming in Java: Harnessing the Power of Java 8 Lambda Expressions](http://www.amazon.com/Functional-Programming-Java-Harnessing-Expressions/dp/1937785467/ref=sr_1_1)
584596
* [Martin Fowler - Service Layer](http://martinfowler.com/eaaCatalog/serviceLayer.html)
597+
* [Martin Fowler - Specifications](http://martinfowler.com/apsupp/spec.pdf)
585598

586599

587600

0 commit comments

Comments
 (0)