From 92d73282fb7df06e24e54cd9bd97f34971479d9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ilkka=20Sepp=C3=A4l=C3=A4?= Date: Sun, 24 Aug 2014 09:33:42 +0300 Subject: [PATCH] Update README.md --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index 02384777b..8370a918e 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,13 @@ ##Factory Method **Intent:** Define an interface for creating an object, but let subclasses decide which class to instantiate. Factory Method lets a class defer instantiation to subclasses. +![alt text](https://github.com/iluwatar/java-design-patterns/blob/master/factory-method/etc/factory-method.jpg "Factory Method") + +**Applicability:** Use the Factory Method pattern when +* a class can't anticipate the class of objects it must create +* a class wants its subclasses to specify the objects it creates +* classes delegate responsibility to one of several helper subclasses, and you want to localize the knowledge of which helper subclass is the delegate + ##Prototype **Intent:** Specify the kinds of objects to create using a prototypical instance, and create new objects by copying this prototype.