CSE Roadmap

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. 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. 2

    Abstract factory

    Create whole families of matching objects through one interface

    Common 6 parts · about 2 hours

  3. 3

    Builder

    Build objects with many options, step by step, and keep them safe

    Core 6 parts · about 3 hours

  4. 4

    Singleton

    Exactly one instance, how to write it safely, and why to be careful

    Core 6 parts · about 3 hours

  5. 5

    Prototype

    Make new objects by copying a ready-made one

    Common 6 parts · about 2 hours

  6. 6

    Dependency injection

    Hand each class what it needs, from outside

    Core 6 parts · about 3 hours