Two uses of the Factory
pattern come to mind immediately (there are sure to be others with many more examples):
1) To control the number and way that objects are created. This could be for caching or pooling reasons, or simply to ensure that only certain instances of a class are created (Aside: I've seen Factory classes used when a Type-Safe Enum pattern would be more appropriate, but that's another show...).
2) When you want to create specific concrete instances of classes that extend an abstract class, or implement an interface, based upon run-time information.
As an example, let's say that we have a Widget interface that defines the attributes and behavior of widgets, but that there are vendor-specific differences on how the behaviors manifest themselves. All vendor widgets implement Widget so our code doesn't care which vendor's widget we have as long as it behaves correctly. The factory class is responsible for creating the correct concrete instance (perhaps using info passed to it, and/or environmental values) and returning the Widget-implementing object.
hth,
bear
[ June 14, 2002: Message edited by: Bear Bibeault ]