Engineering Notes
Technical write-ups on PHP, Symfony and domain modeling. The kind of detail that doesn't fit a service page: full code, real trade-offs, no generic tutorials.
-
Recorded, Not Injected
Publish a domain event the moment an aggregate method runs, and you're announcing something before you know it's true. An
AggregateRootbase class withrecordThat()andpullEvents()fixes exactly that, and opens three smaller ways to get it wrong instead. -
The Readonly Trap
readonlytells PHP a property can't be reassigned. It says nothing about whether two values are equal, or whether what's inside stays immutable. A full DDD booking aggregate shows exactly where that gap bites.