Can any one explain the difference between factory and strategy patterns?
For me both are looking same other than an extra factory class (which create an object of
The strategy pattern allows you to polymorphically change behavior of a class.
The factory pattern allows you to encapsulate object creation.
Gary makes a great point. If you are using the principle of coding to abstractions rather than "concretions" then a lot of the patterns start looking like variations on a theme.