X Tutup
Skip to content

Commit 892a171

Browse files
committed
2 parents 19c4b56 + 92d7328 commit 892a171

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,13 @@
2525
##Factory Method
2626
**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.
2727

28+
![alt text](https://github.com/iluwatar/java-design-patterns/blob/master/factory-method/etc/factory-method.jpg "Factory Method")
29+
30+
**Applicability:** Use the Factory Method pattern when
31+
* a class can't anticipate the class of objects it must create
32+
* a class wants its subclasses to specify the objects it creates
33+
* classes delegate responsibility to one of several helper subclasses, and you want to localize the knowledge of which helper subclass is the delegate
34+
2835
##Prototype
2936
**Intent:** Specify the kinds of objects to create using a prototypical instance, and create new objects by copying this prototype.
3037

0 commit comments

Comments
 (0)
X Tutup