What is the purpose of the Factory Method design pattern?
- To create objects without specifying the exact class of object that will be created.
- To define an interface for creating objects in a superclass, but allow subclasses to alter the type of objects that will be created.
- To encapsulate the creation of objects within a separate class.
- To provide a way to instantiate objects of a specified class.
The Factory Method design pattern provides a way to create objects without specifying the exact class of object that will be created. This allows for greater flexibility and modularity in the design of a system.
Loading...