December 2016
Beginner to intermediate
238 pages
6h 10m
English
© Kelt Dockins 2017
Kelt Dockins, Design Patterns in PHP and Laravel, 10.1007/978-1-4842-2451-9_8
Kelt Dockins1
(1)Dolph, Arkansas, USA
$> git checkout simple_factory_methodThe simple factory is not an design pattern you find in the original 90s Gang of Four design patterns book. Yet it is an extremely useful way to create objects—so useful that I made a chapter for it.
The simple factory method simplifies the process of creating new concrete objects.
Using a simple factory makes code cleaner and easier to deal with. This pattern can be applied when you want to create an object that has dependencies. This pattern can be used to refactor places in code where products are created. One might say that this ...
Read now
Unlock full access