In an event_sourced environment, such as the Ruby toolkit event_sourcery the Aggregate Root has a clear function: to setup, compile data and emit events. As outlined in 'What's an Aggregate Root?'.
Events, emitted by that Aggregate Root, for example a Place
, would emit a PlaceAdded
event.
Subscribed processors then ensure a record is added to a projection, a table in a query database. For example the table proposed_places
.
On the other side of the application, the Q part of CQRS, there are queries that can be performed; e.g. LatestProposedPlacesQuery
will return a list of Proposed places from the proposed_places
table.
So far the set-up (and I'm not confident this is entirely correct, either).
Now, I'm wondering if the aggregate mentioned above, the Place
Aggregate, is the proper thing to return when querying. In other words, should the query of Proposed Places return a list of Place
s aggregate root objects? Or is the Aggregate only concerned with the command/write part of the application? Or am I completely misunderstanding this alltogether?