Factory (object-oriented programming)

Factory Method in LePUS3

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.[a] 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.

  1. ^ Gamma, Erich (1994). Design Patterns. Addison-Wesley. pp. 18–19. ISBN 9780321700698.


Cite error: There are <ref group=lower-alpha> tags or {{efn}} templates on this page, but the references will not show without a {{reflist|group=lower-alpha}} template or {{notelist}} template (see the help page).