Skip to content

Creational patterns

Patterns for creating objects without tying your code to concrete classes.

5 guides61 min in totalDesign patterns

The guides, in order

Read them top to bottom: each one builds on the ones before. The ones you've read carry a check.

About this group

What you'll find
Factory Method, Abstract Factory, Builder, Prototype and Singleton, the last one with its problems and how to replace it.
It's for you if…
your code is full of "new" and conditionals deciding which object to create.
How each guide works
Each guide explains the problem the pattern solves, the solution and an analogy, with a structure diagram and its participants. Then come when to apply it, how to implement it step by step, pros and cons, how it relates to other patterns and code in TypeScript, Python and PHP.