You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 0b17abd
Browse filesBrowse the repository at this point in the historyBrowse files
* you need to select a subset of objects based on some criteria, and to refresh the selection at various times
27
-
* you need to check that only suitable objects are used for a certain role (validation)
27
+
* You need to select a subset of objects based on some criteria, and to refresh the selection at various times.
28
+
* You need to check that only suitable objects are used for a certain role (validation).
29
+
30
+
## Explanation
31
+
32
+
Real world example
33
+
34
+
> There is a pool of different creatures and we often need to select some subset of them. We can write our search specification such as "creatures that can fly" and give it to the party that will perform the filtering.
35
+
36
+
In Plain Words
37
+
38
+
> Specification pattern allows us to separate the search criteria from the object that performs the search.
39
+
40
+
Wikipedia says
41
+
42
+
> 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.
43
+
44
+
**Programmatic Example**
45
+
46
+
If we look at our creature pool example from above, we have a set of creatures with certain properties.
0 commit comments