Event Sourcing: where to put business logic
<p>I can think of two places where to put the domain logic in an event sourced system either one has a drawback.</p>

<ul>
<li>In an event handler of the Aggregate, called locally after creating the event. (That's what I saw in most <a href="https://github.com/gregoryyoung/m-r/blob/master/SimpleCQRS/Domain.cs#L19" rel="noreferrer">examples</a> though most of them have very simplistic logic)<br>
<strong>Issue</strong>: The event stored in the event store and published to subscribers does not include this processed data and therefore on the projection the same logic has to be applied to the event. </li>
<li>Before creating the event. Now the processed data can be stored in the event and the projection doesn't have to know anything about business logic. (I haven't seen this method in examples)<br>
<strong>Issue</strong>: In this case though the event only includes the processed data which possibly can lead to information loss.<br>
Even worse: I also loose the possibility to correct wrong business logic by replaying the events because the event data already has been calculated. </li>
</ul>

<p><strong>Example</strong>: Calculating a metric from some data.<br>
 Either I have to calculate the metric twice (one time in the domain model, one time in the projection)<br>
 or I have to calculate it before sending the event and including it there.</p>