GO LEARNING PATH · 5 LESSONS
Patterns: creation
Factory Method, Abstract Factory, Builder, Prototype and Singleton.
Factory Method: supply the creation step
Vary product creation without duplicating the algorithm that uses it.
3 min · Worked lesson
Abstract Factory: compatible product families
Create related products through one selected family.
3 min · Worked lesson
Builder: assemble then validate
Represent staged construction without making invalid results usable.
3 min · Worked lesson
Prototype: copy a useful starting value
Choose shallow or deep copying according to ownership.
3 min · Worked lesson
Singleton: once does not mean global mutable state
Understand one-instance intent and choose an explicit lifetime.
3 min · Worked lesson