The Patterns and Principles course is complete
Building Maintainable PHP Applications: Patterns and Principles is complete. All 11 chapters and 45 lessons are published, and the course is free. It's the second of six courses in the series. The first five chapters went live on 5 October, and the other six are now live too.
What the course is about
Foundations covered how to think about code that has to keep changing. Patterns and Principles is about what to do with that thinking in the codebase you already have. Each lesson is a tool, pattern or habit you can add to an existing Laravel, Symfony or plain PHP project. None of them needs a rewrite or a new architecture first.
The first chapter sets the rule for the rest of the course: pick up a pattern when it solves a specific problem in front of you, and leave it in the box otherwise. Most lessons are code-heavy, with examples in Laravel, Symfony or plain PHP.
What's inside
| Chapter | Lessons | What it covers |
|---|---|---|
| Tools, Not Rules | 1 | How to treat the patterns in this course as tools for a specific problem |
| Small Objects, Big Impact | 2 to 6 | Primitive obsession, DTOs, value objects, named constructors and immutable objects |
| Principles of Good Object Design | 7 to 12 | Tell, Don't Ask, the Law of Demeter, composition vs inheritance, rich domain models, SOLID and guard clauses |
| Wiring Things Together | 13 to 17 | Dependency injection vs the service locator, factories, repositories, Active Record vs Data Mapper, and the catch-all Service class |
| Behavior and Variation | 18 to 23 | Decorator, Strategy, Specification, Null Object, domain events, and why Singleton is usually the wrong tool |
| Commands and Queries | 24 to 27 | Command-query separation, commands and command handlers, queries and query handlers, and CQRS |
| Commands, Queries and Events on a Bus | 28 to 30 | A command bus, a query bus that caches answers, and an event bus that hands one event to many listeners |
| Persistence, Flow and State | 31 to 34 | Unit of Work and Identity Map, the Pipeline pattern, the State pattern and the Builder pattern |
| Failure and Validation | 35 to 38 | Exceptions as design, domain vs framework exceptions, the Result pattern, and where input and domain validation belong |
| Testing as a Discipline | 39 to 44 | The testing pyramid, test doubles, TDD, BDD, mutation testing and refactoring without changing behavior |
| Putting It Together | 45 | A capstone that refactors a legacy reservation feature and keeps only the patterns that earn their place |
The course is marked intermediate. It's written for developers who already build PHP applications and want to improve the one they work in today.
What's new since the first five chapters
The last two newsletters said the first five chapters were live, 23 lessons in all. Chapters 6 to 11 add the other 22 lessons. They cover commands, queries and the buses that route them, Unit of Work, Pipeline, State and Builder, exceptions and result objects, testing, and the capstone.
What comes next
Architectures is the third course in the series, and it goes live on 16 November. It steps back from single patterns to the shape of the whole application. It walks through Hexagonal Architecture, Clean Architecture and Vertical Slices, what each one tries to solve, and where each one hurts. It ends with a capstone that restructures Hearth, the hotel booking app the course builds on, around ports, slices and modules.
Free content keeps coming
Insights and quick tips stay free to read, and new free courses, learning paths, code reviews, insights, quick tips and projects keep being released alongside the paid catalogue.
Follow along
New content is announced on X, Bluesky, LinkedIn, Facebook, Instagram, as well as the newsletter as it publishes.