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
Factory (and FactoryMethod returned by Factory):
Have a look at this wikipedia article and javarevisited article
Strategy pattern:
Example:
You can configure Discount strategy for a particular item ( AirFare ticket or ShoppingCart item). In this example, you will offer 25% discount to an item during July - December and No discount on the item during Jaunary - June.
Related posts:
Real World Example of the Strategy Pattern
Design Patterns: Factory vs Factory method vs Abstract Factory