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. -
Readonly Doesn't Make a Value Object
final readonly classmakes a Value Object immutable, not comparable. Why===andarray_unique()break on equal values, and theequals()contract PHP leaves to you.