Factory Pattern
Object is basically instace of there prototype called class. There are lot of ways to create the object in various technologies. But ultimately we need to create an object.
What is the strategy of creating objects. weather we use “new” key word to create an object or we are using the method to get the created object.
Factory pattern defines a way and handle creation the objects. It is basically talks about the obtects which are helpful to create the object without knowing the class of the object.Factory pattern encapsulate object creation.
How do we implement Factory pattern?
Accroding to GOF
Define an interface for creating an object but let subclasses decide which class to instanciate. Factory method lets a class difer instantiation to subclass.

Leave a Reply