A request passing along a chain of four handlers, Log, Authorise, Cache and Handle, each calling next() to hand it on.Course · 4 lessons · 1 hr 51 min

Design Patterns Course

All twenty-three Gang of Four design patterns, plus Simple Factory and Repository, in modern C#, in four lessons: what a pattern is, then the creational, structural and behavioural families. Every pattern has its intent in one line, the smallest C# that expresses it, when to use it and what it costs, and where it appears in low-level design problems such as the parking lot and the elevator.

Start the course →
  1. Lesson 1 7 min

    Declarative Design Patterns in C#

    What a design pattern is, what the creational, structural and behavioural families are, and how delegates, events, generics, records and pattern matching in modern C# replace most of the class hierarchies. The overview of a course covering all twenty-three Gang of Four patterns.

  2. Lesson 2 18 min

    Creational Design Patterns in C#

    Simple Factory, Factory Method, Abstract Factory, Builder, Singleton and Prototype in modern C#, written with generics, default interface methods, Lazy<T> and records, each with its uses, trade-offs and examples from low-level design problems such as the parking lot.

  3. Lesson 3 31 min

    Structural Design Patterns in C#

    Decorator, Adapter, Facade, Bridge, Composite, Flyweight, Proxy and Repository in modern C#, written with small wrappers, default interface methods, ConcurrentDictionary and DispatchProxy, each with its uses, trade-offs and examples from low-level design problems such as the parking lot.

  4. Lesson 4 55 min

    Behavioural Design Patterns in C#

    Strategy, Command, Template Method, Chain of Responsibility, Observer, State, Iterator, Mediator, Memento, Visitor and Interpreter in modern C#, where delegates, events, records and pattern matching replace the class hierarchies, each with its uses, trade-offs and examples from low-level design problems such as the elevator.