Factory (object-oriented programming)
Object that creates other objects / From Wikipedia, the free encyclopedia
Dear Wikiwand AI, let's keep it short by simply answering these key questions:
Can you list the top facts and stats about Factory pattern?
Summarize this article for a 10 year old
SHOW ALL QUESTIONS
"Factory pattern" redirects here. For the GoF design patterns using factories, see factory method pattern and abstract factory pattern.
In object-oriented programming, a factory is an object for creating other objects; formally, it is a function or method that returns objects of a varying prototype or class[1] from some method call, which is assumed to be "new".[lower-alpha 1] More broadly, a subroutine that returns a "new" object may be referred to as a "factory", as in factory method or factory function. The factory pattern is the basis for a number of related software design patterns.