Below you will find pages that utilize the taxonomy term “new”
Posts
Firing Domain Events in the __constructor
After my post about “Good ORMs do not call __construct a.k.a. where to fire my Domain Events”, nice discussions (and trolling) are happening in the Barcelona Engineering Slack Channel. Thanks to everyone for the feedback, ideas and concerns. You are more than welcome! The main concerns are:
- How do I fetch an Entity from ElasticSearch, using new and without firing the Event?
- How do I create stubs on the Entity that is firing the Domain Event?
- What are pros and cons of firing the Domain Event in the __constructor or in the named constructor?
So, I’ll take the original code as a starting point, and I’ll suggest different strategies to answer those questions.
Posts
“new” and fluent interfaces
Last week, I was with some friends and we were talking about fluent interfaces and I show them something that they didn’t know. I got surprised about it because it was introduced in PHP 5.4.