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.
- Welcome to Design Patterns (4 topics, 7 lessons)
- The Object-Oriented Code You Need (3 topics, 7 lessons)
- Drawing Structure: Class and Object Diagrams (5 topics, 8 lessons)
- The Ideas Behind Every Pattern (3 topics, 5 lessons)
- SOLID in Plain Words (2 topics, 6 lessons)
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.
- Version 1: It Works (4 topics, 6 lessons)
- The Owner's Wish List (4 topics, 4 lessons)
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.
- Statuses and Routes (5 topics, 7 lessons)
- Every Carrier Does It Differently (4 topics, 5 lessons)
- Shipments with Many Parts (4 topics, 5 lessons)
- The Dispatcher's Undo Button (3 topics, 4 lessons)
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.
- Three Brands, Three Shapes (4 topics, 6 lessons)
- Slow and Far Away (4 topics, 5 lessons)
- When the Other System Is Down (3 topics, 4 lessons)
- Routines and Messages (5 topics, 6 lessons)
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.
- Wiring the App Together (4 topics, 6 lessons)
- Inside the Framework (3 topics, 5 lessons)
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).
- Rules Your Users Write (3 topics, 3 lessons)
- Too Many, Too Expensive (3 topics, 3 lessons)
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.
- Code Smells: Symptom, Cause, Cure (3 topics, 7 lessons)
- Changing Old Code Safely (4 topics, 6 lessons)
- Making Your Own Patterns (4 topics, 6 lessons)