This trips me several times, and smells duplication:
- I have to compute the aggregate id in application service handlers,
- Then again in the
When method in aggregate state
Also, if I don't set the Id explicit on my state object, at least on the very first event, then my aggregate has no id.
I can see why the service need me to compute the id from incoming command, but the id is known at the time When runs. Which means it's known to the aggregate. Is it really necessary to keep the id in the aggregate state?
This trips me several times, and smells duplication:
Whenmethod in aggregate stateAlso, if I don't set the
Idexplicit on my state object, at least on the very first event, then my aggregate has no id.I can see why the service need me to compute the id from incoming command, but the id is known at the time
Whenruns. Which means it's known to the aggregate. Is it really necessary to keep the id in the aggregate state?