diff --git a/README.md b/README.md index 4823f9b..0cb3a36 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ - [Creational patterns](#creational-patterns) - [Singleton](#singleton) - [Builder](#builder) + - [Factory](#factory) - [Structural patterns](#structural-patterns) - [Composition](#composition) - [Behavioral patterns](#behavioral-patterns) @@ -29,6 +30,10 @@ Ensure a class only has one instance, and provide a global point of access to it Separate the construction of a complex object from its representation so that the same construction process can create different representations. +### Factory +Define an interface for creating an object, but let subclasses decide which class to +instantiate. Factory Method lets a class defer instantiation to subclasses. + ## Structural patterns Structural patterns are concerned with how classes and objects are composed to form larger structures. Structural class patterns use inheritance to compose interfaces or implementations.