Yes, they seem to be same but they do have a visible difference. Factory's sole purpose is to create objects and strategy's sole intent to is to provide a mechanism to select different algorithm.
You can use "factory" to create objects of "strategy". For. e.g. take the following example from dofactory for strategy..
SortedList studentRecords = new SortedList();
Now note here, the type passed in the "SetSortStrategy" method is "hardcoded" and this will be a fragile design if this is some kind of production code.
To make this more resilent to change introduce factory (this is a crude example and is only for demonstration purpose)
SortStrategy algo = SortFactory.GetQuickSort(); // something like this... the actual instance creation of quicksort is controlled by the SortFactory and this is well abstracted from the client.
Let me know whether this is useful or you need more clarifications.
Rajesh Pillai, Aug 06, 2010