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: chapter04_factory/readme.md
+6-2Lines changed: 6 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,10 @@
2
2
3
3
**Simple Factory**: A class which chooses which product class to instantiate and return, based upon method parameters.
4
4
5
-
**Factory Method**: Define an interface for creating an object, but let subclasses decide which class to instantiate. The Factory method lets a class defer instantiation it uses to subclasses.
5
+
**Factory Method**: Defines an interface for creating an object, but lets subclasses decide which class to instantiate. The Factory method lets a class defer instantiation to subclasses.
6
6
7
-
**Abstract Factory**: Provide an interface for creating families of related or dependent objects without specifying their concrete classes.
7
+
For instance the `PizzaStore` abstract class in this repo provides an abstract `create_pizza` interface for creating one product.
8
+
9
+
**Abstract Factory**: Provides an interface for creating families of related or dependent objects without specifying their concrete classes.
10
+
11
+
For instance the `PizzaIngredientFactory` abstract class defines an interface for a family of products.
0 commit comments