Computing Atlas

How Computing Was Built
Sign In
Text size
100%
Theme
Concept

Factory Method Pattern

Technique

A Gang of Four creational design pattern that defines an interface for creating an object but lets a subclass decide which concrete class to instantiate, decoupling the code that requests an object from the code that constructs it.

Facts
Origin Year
1994 1
Core Principle
Defines an interface for creating an object but lets subclasses decide which concrete class to instantiate, so a class can defer object creation to its subclasses. 2
Connections

Associated With

Erich Gamma, Pioneers

Erich Gamma co-authored the 1994 Design Patterns book that named and catalogued the Factory Method pattern among the original 23.

In Field

Sources
1. Wikipedia: Design Patterns (book)
Wikimedia FoundationLead section, first sentence
Quote, Lead section, first sentence
Design Patterns: Elements of Reusable Object-Oriented Software (1994) is a software engineering book describing software design patterns.
View the Source
2. Wikipedia: Factory Method Pattern
Wikimedia FoundationDefinition section, quoting Design Patterns
Quote, Definition section, quoting Design Patterns
Define an interface for creating an object, but let subclasses decide which class to instantiate. Factory method lets a class defer instantiation to subclasses.
View the Source
Comments (0)
No comments yet. Be the first to share a thought.
Reader Challenges (0)
No disputes yet. Spotted an error or a better source? Open the first one.