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
Core PrincipleDefines 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 sentenceQuote, 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 PatternsQuote, 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 Reader Challenges (0)
No disputes yet. Spotted an error or a better source? Open the first one.
Sign in to dispute this or suggest a correction.