You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+9Lines changed: 9 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -63,6 +63,15 @@ Use the Chain of Responsibility pattern when
63
63
64
64
* The set of objects that can handle a request should be specified dynamically.
65
65
66
+
#### 6.Factory Method
67
+
Define an interface for creating an object, but let subclasses decide which to instantiate. Factory Method lets a class defer instantiation to subclasses.
68
+
69
+
##### Applicability:
70
+
Use the Factory Method pattern when
71
+
* A class can't anticipate the class of object it must create.
72
+
* A class wants its subclasses to specify the objects it creates.
73
+
* Classes delegate responsibility to one of several helper subclasses, and you want to localize the knowledge of which helper subclasses is the delegate.
0 commit comments