Where Is Abstract Factory Design Pattern Used
The Purpose of the Abstract Factory Is to Provide an Interface for Creating Families of Related Objects, Without Specifying Concrete Classes. This Pattern Is...
The purpose of the Abstract Factory is to provide an interface for creating families of related objects, without specifying concrete classes. This pattern is found in the sheet metal stamping equipment used in the manufacture of Japanese automobiles.
Where is factory design pattern used?
- A class cannot anticipate the type of objects it needs to create beforehand.
- A class requires its subclasses to specify the objects it creates.
- You want to localize the logic to instantiate a complex object.
Is Abstract Factory useful?
You need abstract factory when different polymorphic classes has different instantiation procedure. And you want some module to create instances and use them, without knowing any details of object initialization. For example – you want to create Java objects doing some calculations.