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
Copy file name to clipboardExpand all lines: README.md
-5Lines changed: 0 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -43,11 +43,8 @@ Use the Template Method pattern when
43
43
Use the Strategy pattern when
44
44
45
45
* Many related classes differ only in their behavior. Strategies provide a way to configure a class with one of many behaviors.
46
-
47
46
* You need different variant of an algorithm. For example, you might need define algorithms reflecting different space/time trade-offs. Strategies can be used when these variants are implemented as a class hierarchy of algorithm.
48
-
49
47
* An algorithm uses data that clients shouldn't know about. Use the strategy pattern to avoid exposing complex, algorithm-specific data structures.
50
-
51
48
* A class defines many behaviors, and these appear as multiple conditional statements in its operations. Instead of many conditionals, move related conditional branches into their own Strategy class.
52
49
53
50
@@ -58,9 +55,7 @@ Use the Template Method pattern when
58
55
Use the Chain of Responsibility pattern when
59
56
60
57
* More than one object may handle a request, and the handler isn't known a priori. The handler should be ascertained automatically.
61
-
62
58
* You want to issue a request to one of several objects without specifying the receiver explicitly.
63
-
64
59
* The set of objects that can handle a request should be specified dynamically.
0 commit comments