factory method pattern
Sign in to savecreational pattern that uses factory methods to deal with the problem of creating objects without having to specify the exact class of the object that will be created
Wikidata facts
Show 2 more facts
- Stack Exchange tag
- stackoverflow.com/tags/factory-method
- Commons gallery
- Factory method
Sources (1)
via Wikidata · CC0
~13 min read
Article
In object-oriented programming, the factory method pattern is a design pattern that uses factory methods to deal with the problem of creating objects without having to specify their exact classes. Rather than by calling a constructor, this is accomplished by invoking a factory method to create an object. Factory methods can be specified in an interface and implemented by subclasses or implemented in a base class and optionally overridden by subclasses. It is one of the 23 classic design patterns described in the book Design Patterns and is subcategorized as a creational pattern.
Overview