1
Reply

When to Use a Factory Pattern

Ravi Kumar

Ravi Kumar

18y
6.8k
0
Reply

    • When a class does not know which class of objects it must create.
    • A class specifies its sub-classes to specify which objects to create.
    • Generally, you can use factory pattern where you have to create an object of any one of sub-classes depending on the data provided.