Factory Pattern


A factory pattern is a creational design pattern that defines an interface or abstract class for creating an object but lets the subclasses decide which class to instantiate.