Level 3 of 7 · about 1 week
Patterns I: creating objects
Factories, builders, singletons, prototypes and dependency injection: who creates objects, and how.
Modules
Core: everyone needs it. Common: most jobs use it. Specialist: optional depth, safe to skip on a first read.
1
Factory method and simple factory
Move the word new out of the code that should not know the class
Core 6 parts · about 3 hours
2
Abstract factory
Create whole families of matching objects through one interface
Common 6 parts · about 2 hours
3
Builder
Build objects with many options, step by step, and keep them safe
Core 6 parts · about 3 hours
4
Singleton
Exactly one instance, how to write it safely, and why to be careful
Core 6 parts · about 3 hours
5
6