The Factory pattern provides a way to use an instance as a object factory.The factory can return an instance of one of several possible classes(in a subclass hierarchy),depending on the date provided to it.
Where to use
- when a class can anticipate which kind of class of object it must create.