Updating query results
- by Francisco Garcia
Within a DDD and CQRS context, a query result is displayed as table rows. Whenever new rows are inserted or deleted, their positions must be calculated by comparing the previous query result with the most recent one. This is needed to visualize with an animation new or deleted rows.
The model of my view contains an array of the displayed query results. But I need a place to compare its contents against the latest query.
Right now I consider my model view part of my application layer, but the comparison of two query result sets seems something that must be done within the domain layer.
Which component should cache a query result and which one compare them?
Are view models (and their cached contents) supposed to be in the application layer?