Design Patterns, Demystified

Design patterns the way they were found: by building apps and solving the problems they meet. Five apps, each planned, built and changed (a bakery, a package…

Updated

Module 1: Before You Build

Before any pattern: what a design pattern really is (a fix teams kept finding, given a name), the object-oriented code every pattern is built from, class and object diagrams, how to tell code has a problem, and the ideas behind every pattern, SOLID included.

Module 2: A Small App That Works

The first pass: a bakery's ordering app, planned, built and then changed by its owner, where the first patterns turn up: a factory for new products, a deal passed in as a function, a kitchen screen that listens, one checkout button, and the trap of a Singleton.

Module 3: The App Grows

The second pass: a package-delivery tracker that grows statuses, routes, carriers, shipments with many parts and an undo button, with sequence and state diagrams, and the patterns teams found for each: State, Iterator, Strategy, Template Method, Factory Method, Builder, Prototype, Composite and Command.

Module 4: Talking to Other Systems

The third pass: a smart-home hub that talks to devices from three brands and a weather service that's slow and sometimes down, where Adapter, Abstract Factory, Bridge, Proxy, Decorator, Null Object, Retry, Circuit Breaker, Chain of Responsibility, Mediator, publish/subscribe and Memento earn their place.

Module 5: Going to Work on a Framework

The fourth pass: a library's checkout web API on a real framework, and the patterns the framework itself is built from: dependency injection, repositories, MVC and MVVM, and middleware.

Module 6: More Problems, More Patterns

Real problems none of the apps ran into, and the patterns that solve them: rules your users write (Interpreter and Visitor), and things too many or too expensive to make one at a time (Flyweight, Object Pool and Lazy Loading).

Module 7: Rescuing a Legacy App

The last pass: rescuing an old gym class-booking system. Code smells read as symptom, cause and cure; changing old code safely under tests; replacing it piece by piece; pattern fever and anti-patterns; and noticing, naming and sharing patterns of your own.