Book description
Real examples written in PHP showcasing DDD Architectural Styles, Tactical Design, and Bounded Context Integration
About This Book
- Focuses on practical code rather than theory
- Full of real-world examples that you can apply to your own projects
- Shows how to build PHP apps using DDD principles
Who This Book Is For
This book is for PHP developers who want to apply a DDD mindset to their code. You should have a good understanding of PHP and some knowledge of DDD. This book doesn't dwell on the theory, but instead gives you the code that you need.
What You Will Learn
- Correctly design all design elements of Domain-Driven Design with PHP
- Learn all tactical patterns to achieve a fully worked-out Domain-Driven Design
- Apply hexagonal architecture within your application
- Integrate bounded contexts in your applications
- Use REST and Messaging approaches
In Detail
Domain-Driven Design (DDD) has arrived in the PHP community, but for all the talk, there is very little real code. Without being in a training session and with no PHP real examples, learning DDD can be challenging. This book changes all that. It details how to implement tactical DDD patterns and gives full examples of topics such as integrating Bounded Contexts with REST, and DDD messaging strategies. In this book, the authors show you, with tons of details and examples, how to properly design Entities, Value Objects, Services, Domain Events, Aggregates, Factories, Repositories, Services, and Application Services with PHP. They show how to apply Hexagonal Architecture within your application whether you use an open source framework or your own.
Style and approach
This highly practical book shows developers how to apply domain-driven design principles to PHP. It is full of solid code examples to work through.
Table of contents
- Foreword
- Acknowledgments
- Dedication
-
Preface
- Who Should Read This Book
- DDD and PHP Community
-
Summary of Chapters
- Chapter 1: Getting Started with Domain-Driven Design
- Chapter 2: Architectural Styles
- Chapter 3: Value Objects
- Chapter 4: Entities
- Chapter 5: Domain Services
- Chapter 6: Domain-Events
- Chapter 7: Modules
- Chapter 8: Aggregates
- Chapter 9: Factories
- Chapter 10: Repositories
- Chapter 11: Application
- Chapter 12: Integrating Bounded Contexts
- Appendix: Hexagonal Architecture with PHP
- Code and Examples
- Getting Started with Domain-Driven Design
- Architectural Styles
-
Value Objects
- Definition
- Value Object vs. Entity
- Currency and Money Example
- Characteristics
- Basic Types
- Testing Value Objects
-
Persisting Value Objects
- Persisting Single Value Objects
- Serialized LOB and Ad Hoc ORM
- Serialized LOB with Doctrine
- NoSQL
- Security
- Wrap-Up
- Entities
- Services
- Domain-Events
- Modules
- Aggregates
- Factories
- Repositories
- Application
- Integrating Bounded Contexts
-
Hexagonal Architecture with PHP
- Introduction
- First Approach
- Repositories and the Persistence Edge
- Decoupling Business and Persistence
- Migrating our Persistence to Redis
- Decouple Business and Web Framework
- Rating an Idea Using the API
- Console App Rating
- Testing Rating an Idea UseCase
- Testing Infrastructure
- Arggg, So Many Dependencies!
- Domain Services and Notification Hexagon Edge
- Let's Recap
- Hexagonal Architecture
- Key Points
- What's Next?
- Bibliography
- The End
Product information
- Title: Domain-Driven Design in PHP
- Author(s):
- Release date: June 2017
- Publisher(s): Packt Publishing
- ISBN: 9781787284944
You might also like
book
Deciphering Data Architectures
Data fabric, data lakehouse, and data mesh have recently appeared as viable alternatives to the modern …
book
Object Design Style Guide
Object Design Style Guide presents dozens of professional techniques for writing OO code. In it, veteran …
book
Building Micro-Frontends
What's the answer to today's increasingly complex web applications? Micro-frontends. Inspired by the microservices model, this …
book
Software Architecture for Busy Developers
A quick start guide to learning essential software architecture tools, frameworks, design patterns, and best practices …