ENGLISH
REFERENCE

factory pattern

compound.
C1 Advanced Programming
Definition

compound. a way of writing computer code where one part of the program creates objects for you. Instead of making a specific item yourself, you ask a 'factory' to do it, which makes the code easier to change later.

compound. a creational design pattern that uses a dedicated interface or method to instantiate objects without specifying the exact class of the object that will be created. This promotes loose coupling by delegating the responsibility of object instantiation to a specialized component.


SIMPLE

The developer used a factory pattern to create different types of user accounts.

CONTEXTUAL

By implementing a factory pattern, the software can easily support new file formats without modifying the core logic of the document processor.

COMPLEX

Adopting a factory pattern allows the framework to remain extensible, as it decouples the client code from the concrete implementations of the interfaces it consumes during runtime.

Origin

A compositional term formed from the noun factory, denoting a site of industrial manufacture, and pattern, in the sense of a reusable architectural design. The metaphor was formalised by Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides in their 1994 publication on software design.

Etymology adapted from Wiktionary, available under CC BY-SA 4.0.

Usage

Commonly used in object-oriented programming; often referred to as the 'Factory Method' or 'Abstract Factory' depending on the specific implementation.

Related words

Last updated July 22, 2026