Title page

"A practical guide on providing you a breakthrough in your architectural skills to build web applications in an adaptive & sustainable manner." -- Mohammad Emran Hasan

Web applications deserve to outlive the currently fashionable framework. Your application's core use cases deserve to be decoupled from their surrounding infrastructure. And all of your domain-specific code needs to be testable; it has to be tested after all.

This book helps you get your web applications back in shape. It contains many techniques for decoupling from infrastructure (like the framework, the database, or remote web services). In Part 1 we unlock a collection of design patterns which help you establish a clean separation between core and infrastructure code. Part 2 shows how these design patterns resonate at a higher level with architectural concepts like layers, ports and adapters (a.k.a. Hexagonal architecture). The book finishes with a discussion of testing strategies and design trade-offs.

What you'll learn

  • Separating mixed code into core and infrastructure code by refactoring into patterns
  • Dividing your code into layers, and making a clear distinction between an application's ports and adapters
  • Testing decoupled applications

Each chapter comes with exercises to test your understanding.

This is a book for experienced web developers. Code samples are written in PHP and are easy to follow by developers who write code in other OOP dialects, like C#, Java, etc.

"The best guide that brings your coding and architecture skills a level up. All the modern PHP features combined with the elegance of a well designed modular design." -- José María Valera Reales

There is an accompanying real-world project that showcases the design techniques and principles explained in this book: https://advwebapparch.com/repository.

"The author achieves what most others don't - making the core idea so simple that it is near impossible for the reader to get wrong. The only architecture book I would recommend even to my junior colleagues." -- Ondřej Bouda

Additional resources