# Factories the Modern Way: A Dictionary of Functions

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.

![Cheat sheet: Factories the Modern Way: A Dictionary of Functions](https://fsdtrainingmedia.blob.core.windows.net/public/images/2026/11/855fa8071da94a06812212c29a8513d2.webp)

- Category: Data Structures
- Level: Apprentice
- Tags: Higher-Order Function, OOP, Open/Closed Principle, Simple Factory
- Author: Gregor Dzierzon
- Updated: November 17, 2026

Source: https://www.ask-codey.com/cheat-sheets/dp-factories-modern-cheat-sheet
