A New Product Every Month
A New Product Every Month: Simple Factory: One Place That Says new, Factories the Modern Way: A Dictionary of Functions.
Updated
- Simple Factory: One Place That Says new (Apprentice): 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.
- Factories the Modern Way: A Dictionary of Functions (Apprentice): A factory's if chain still grows by one line a month and gets edited by everyone; a dictionary from each product's name to a function that makes it lets a new product be added in one line, from anywhere, without touching the factory.