Simple Factory: One Place That Says new

When the same if chain that picks a class is copied into several places, a new product means editing all of them, and one is always forgotten; a simple factory moves that decision into one function, so a new product is one new class and one new line.

By

Updated

Cheat sheet: Simple Factory: One Place That Says new
Category
Data Structures
Level
Apprentice
Tags
Code Smell, Factory Pattern, OOP, Simple Factory