Top "Strategy-pattern" questions

The Strategy pattern (also known as the policy pattern) is a design pattern whereby an algorithm's behavior can be selected at runtime.

Real World Example of the Strategy Pattern

I've been reading about the OCP principal and how to use the strategy pattern to accomplish this. I was going …

java c# design-patterns strategy-pattern
What is the difference between Strategy design pattern and State design pattern?

What are the differences between the Strategy design pattern and the State design pattern? I was going through quite a …

design-patterns strategy-pattern state-pattern
What is the difference between the template method and the strategy patterns?

Can someone please explain to me what is the difference between the template method pattern and the strategy pattern is? …

design-patterns strategy-pattern template-method-pattern
What is the difference between Factory and Strategy patterns?

Can any one explain the difference between factory and strategy patterns? For me both are looking same other than an …

java design-patterns factory-pattern strategy-pattern abstract-factory
What is the difference between the bridge pattern and the strategy pattern?

I tried to read many articles on dofactory, wikipedia and many sites. I have no idea on differences between bridge …

design-patterns strategy-pattern bridge
Using a strategy pattern and a command pattern

Both design patterns encapsulate an algorithm and decouple implementation details from their calling classes. The only difference I can discern …

design-patterns encapsulation strategy-pattern command-pattern
Difference between Strategy pattern and Command pattern

What is the difference between the Strategy pattern and the Command pattern? I am also looking for some examples in …

java design-patterns strategy-pattern command-pattern
Strategy pattern with spring beans

Say I'm using spring, I have the following strategies... Interface public interface MealStrategy { cook(Meat meat); } First strategy @Component public …

java spring strategy-pattern
Strategy Pattern with no 'switch' statements?

I've been doing some reading on the Strategy Pattern, and have a question. I have implemented a very basic Console …

c# design-patterns dependency-injection strategy-pattern coding-style
When and why should the Strategy Pattern be used?

When would the Strategy Pattern be used? I see client code snippets like this: class StrategyExample { public static void main(…

design-patterns strategy-pattern