Niclas Hedhman wrote:
I thought the Event would carry all data associated with that event at that point in time. That way the 'sender' creates the event with all data it knows of, and the recipient is responsible to understand what is relevant. That way there is not necessarily any read access to the domain model.
In this case, the statistics/reporting service listens for "task completed" events. When one arrives it needs to gather all data about the task and put a denormalized version into the reporting database.
It *could* do this by building up its own view of the domain model by only listening to events. However, it is much simpler to query the domain model for this data when the event comes in, transform it into the denormalized version, and then save it. So, it is a combination of events and querying.
It depends largely on whether you consider the statistics service to be entirely external to the application or not. In this case I chose to let the statistics function be a part of our application, so it may do the query of the domain model to get the data it needs.
/Rickard _______________________________________________ qi4j-dev mailing list [email protected] http://lists.ops4j.org/mailman/listinfo/qi4j-dev

