--
You received this message because you are subscribed to the Google Groups "DDD/CQRS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dddcqrs+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
It sounds like you're interested in more of a user-tracking log, which certainly has merits. I'm not sure treating exceptions as events is the best way to accomplish that, though I admit that from a newbie standpoint it's an intriguing idea.
Do people have experience and recommendations with using exceptions as messages, and do you have any recommended reading in the area?
However, I've had an idea (although most likely not an original one) that exceptions are actually outputs as well, albeit ones that do not mutate state, and that persisting these exceptions provides a number of benefits similar to persisting commands.
First, if you abandon exceptions, you give up the ability of the caller to distinguish between success and failure. This may or may not be an issue (if the command was sent on an asynchronous channel, it doesn't matter, after all -- the caller is waiting for an event on the other side). It might also open up the question of "why throw rather than no-op?"
Second, the events in our book of record are histories of the entities we are tracking. So I don't understand where an exception event would go? Into the history of the aggregate we were going to change? Into the history of a different aggregate that we haven't loaded yet? Were we intending to modify that same aggregate if the command succeeded? In the same transaction? What are you going to do if the attempt to persist the exception fails?
Put another way, are the exceptions a domain concern, or an application concern? If they really are a domain concern, then why aren't we using a protocol in the domain to track each instance?