File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -54,8 +54,8 @@ print_r($veyron->getMakeAndModel()); // outputs "Bugatti Veyron"
54
54
This code uses a factory to create the Automobile object. There are two possible benefits to building your code this
55
55
way; the first is that if you need to change, rename, or replace the Automobile class later on you can do so and you
56
56
will only have to modify the code in the factory, instead of every place in your project that uses the Automobile class.
57
- The second possible benefit is that if creating the object is a complicated job you can do all of the work in the
58
- factory, instead of repeating it every time you want to create a new instance.
57
+ The second possible benefit is that, if creating the object is a complicated job, you can do all of the work in the
58
+ factory instead of repeating it every time you want to create a new instance.
59
59
60
60
Using the factory pattern isn't always necessary (or wise). The example code used here is so simple that a factory
61
61
would simply be adding unneeded complexity. However if you are making a fairly large or complex project you may save
You can’t perform that action at this time.
0 commit comments