2. What ?
• It Is a object creation software design pattern
bhaskarakster@gmail.com
3. When?
• If multiple subclasses exist for a super class and want to instantiate
one of the subclass based on input.
• If you want remove the instantiation of classes from client code, so
that code is not tightly coupled and class implementation can be
changed easily as client does not know the implementation of class.
bhaskarakster@gmail.com
4. How?
• Factory design pattern solves this requirement in the following way
• Create Factory method ( name the class as factory class) which takes the
input and creates instance of subclass and return the same.
• Create Abastract class through which Factory pattern can provide abstraction
between implementation and client classes.
bhaskarakster@gmail.com