Closed vladas closed 8 years ago
All fixes done. Thanks! You are now in the Acknowledgements.
Related to your questions: 1.- You're right. If you don't like it, you can just return the result of the transformation. With that way, both (application service and data transformer) would be stateless. However, it's not a big deal this approach ;)
2.- You have multiple options: Singleton: It works well in most all scenarios Passing the event dispatcher all around: Too gossip. Do you imagine all your Entities receiving the Event Dispatcher as parameter or constructor? Nop. Aggregates collecting all events and then getter: for Aggregates it works in general. However, sometimes is not easy to know what Aggregates where modified and get all the events to publish them. It's also more difficult to fire events from other places such as Domain Services or even Application Services (you should avoid that, but sometimes can work for you legacy projects).
Paragraph 8.6
should be:
Typo?
The following sentence probably should be reviewed:
I assume it was supposed to be "in two Entities".
Undefined variable
$wishId in the following example is undefined.
BaseUserFactory => UserFactory?
In the following code snippet I assume UserFactory should be used instead of BaseUserFactory as it's defined.
Typo sort => short:
DataTransformer state in service
I'm quite sure that it was mentioned in this book, that services shouldn't contain any state. However, in the following example service contains state. Why is state in this example allowed?
Hi guys,
I enjoyed the book a lot. Thanks. Here are somethings I noticed.
DomainEventPublisher singelton
What is the justification for having DomainEventPublisher as a singleton? Doesn't it hide dependency?
It's appearant that Unit tests suffer from singelton problems as well when you have to unsubscribe:
Regards, Vladas Dirzys