ALGORITHMICSGitHub ↗
← All tracks

Design Patterns

GoF patterns shown as running systems.

23 patterns

23/23

  • Patterns 5 min
    Abstract Factory

    Whole families that must match — and the cost of adding one more kind of thing.

  • Patterns 6 min
    Adapter

    Making an incompatible interface fit — and the one file that should know the vendor's vocabulary.

  • Patterns 5 min
    Bridge

    Two things that vary independently, kept from multiplying.

  • Patterns 6 min
    Builder

    Assembling a complicated object step by step — and the validation you can only do at the end.

  • Patterns 5 min
    Chain of Responsibility

    Pass the request along until somebody claims it — and the case nobody handles.

  • Patterns 6 min
    Command

    A request as an object — and the undo stack you get almost for free.

  • Patterns 6 min
    Composite

    Treating one thing and many things identically — and the method that does not belong on a leaf.

  • Patterns 6 min
    Decorator

    Adding behaviour by wrapping rather than subclassing — and why the order of the wrappers is a real decision.

  • Patterns 5 min
    Facade

    One door into a subsystem — and why the door must not become the only way in.

  • Patterns 6 min
    Factory Method

    Letting a subclass decide what to construct — and why a plain function is usually enough.

  • Patterns 5 min
    Flyweight

    Sharing the heavy part between many objects — and the split that makes it possible.

  • Patterns 5 min
    Interpreter

    A grammar as a class hierarchy — and why you should almost always use a parser generator instead.

  • Patterns 6 min
    Iterator

    Walking a collection without knowing its shape — and why laziness is the part that matters.

  • Patterns 5 min
    Mediator

    A hub instead of a mesh — and the risk that the hub becomes the program.

  • Patterns 5 min
    Memento

    A snapshot that only its owner can read — and why undo usually wants commands instead.

  • Patterns 6 min
    Observer

    One-to-many notification without the sender knowing who is listening — and the leak it invites.

  • Patterns 5 min
    Prototype

    Copying an existing object instead of constructing one — and the depth of the copy.

  • Patterns 6 min
    Proxy

    A stand-in with the same interface — and the fact that callers cannot tell is both the feature and the hazard.

  • Patterns 6 min
    Singleton

    One instance, globally reachable — and why the second half of that is the problem.

  • Patterns 6 min
    State

    Behaviour that follows the mode — and how the illegal transitions stop being reachable.

  • Patterns 6 min
    Strategy

    The algorithm as a parameter — and why in most languages it is now just a function.

  • Patterns 5 min
    Template Method

    The skeleton fixed, the steps varied — inheritance's one genuinely good use, and its limits.

  • Patterns 6 min
    Visitor

    Adding an operation without editing the classes — and the price it charges for that.

Coverage

23 of 23 patterns