Imagine a kid making cookies out of dough. They can do nothing until they invoke the
factory method and say, Give me a cutter. So, you provide them with a cookie cutter (the result of the
factory method), and they can finally start making cookies.
By implementing this approach, you can be flexible and select the appropriate cookie shape for the occasion. Output from the factory method therefore changes the final result.
The functionality of this pattern, as described in the original Design Patterns publication, looks very similar to the dependency injection approach, but implemented with pure object-oriented tools. This section will mostly focus on the original approach, but at the end, I will spend some time modernizing this technique.
The pure GoF example is stored in the folder...