Overview of Factory Design Patterns
The Factory pattern encapsulates object creation logic, hiding the instantiation process from the client and providing a common interface. It is generally divided into three types:
- Simple Factory: A basic class that creates objects based on input.
- Factory Method: Defines an interface for creating an object but lets subclasses decide which class to instantiate.
- Abstract Factory: Provides an interface for creating families of related or dependent objects without specifying their concrete classes.