Strategy pattern is also known as Policy Pattern. We define multiple algorithms and let client application pass the algorithm to be used as a parameter. One of the best example of strategy pattern is Collections. sort() method that takes Comparator parameter .
Read moreIs strategy a pattern?
Strategy is a behavioral design pattern that lets you define a family of algorithms, put each of them into a separate class, and make their objects interchangeable.
Read moreWhat does the strategy pattern solve?
The strategy pattern is used to solve problems that might (or is foreseen they might) be implemented or solved by different strategies and that possess a clearly defined interface for such cases .
Read moreWhat are the elements of strategy pattern?
The basic structure of a strategy design pattern in UML with three basic components: Context (main class), Strategy (interface) and ConcreteStrategies (outsourced algorithms and solution policies for solving the specific problem) .
Read moreHow do you use strategy patterns?
Design Patterns – Strategy Pattern
Read more