$> git checkout simple_factory_method
The 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.
Intent
The simple factory method simplifies the process of creating new concrete objects.
Applications
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 ...