can someone throw light on differences between abstract factory pattern and factory method pattern?. i have a feeling(may be a wrong idea) that they both can be used in the same context . thanks Shambhu Lingam
Abstract Factory Pattern Abstract Factory is a tool kit; the usage is when you want to create related objects. Factory Pattern This pattern helps to model an interface for creating an object which at creation time can let its subclasses decide which class to instantiate. We call this a Factory Pattern since it is responsible for "Manufacturing" an Object. It helps instantiate the appropriate Subclass by creating the right Object from a group of related classes. The Factory Pattern promotes loose coupling by eliminating the need to bind application-specific classes into the code. From the intent perspective, there is nothing similar about the two. Regards Malay