From e147dcd8f8891839db8de1be1be5d10a32418194 Mon Sep 17 00:00:00 2001 From: ismayilmalik Date: Tue, 2 Jan 2018 22:11:03 +0300 Subject: [PATCH] implemented factory pattern --- README.md | 5 +++++ 1 file changed, 5 insertions(+) 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.