Skip to content

Commit d2f70ae

Browse files
committed
Strategy pattern documentation
1 parent a4b0caf commit d2f70ae

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Define the skeleton of an algorithm in an operation, deferring some steps to sub
3030
* When the commin behavior among subclasses should be factored and localized in a common class to avoid code duplication. This is a good example of "refactoring to generalize" as described by Opdyke and Johnson. You first identify the differences in the existing code and then separate the differences into new operations. Finally, you replace the differing code with a template method that calls one these new operations.
3131
* To control subclasses extensions. You can define a template method that calls "hook" operations at specific points, thereby permitting extensions only at those points.
3232

33-
#### 2.Strategy
33+
#### 4.Strategy
3434
Define a family of algorithm, encapsulate each one, and make them interchangeable. Strategy lets the algorithm vary independently from clients that use it. [example](https://github.com/hbrawnak/php-design-pattern/blob/master/Strategy/index.php#L4)
3535

3636
##### Applicability:

0 commit comments

Comments
 (0)