ViewModels
We should support some form of ViewModel. A very simple implementation could depend explicitly on MongoDB. I'm struggling to come up with the exact js API, but the features would be:
- readonly
- aggregate data from multiple data sources based on model relations
- focus on read performance (and local caching config?)
- able to be created without DBAs / sql / etc
- avoid joins and slow SQL operations
- query the aggregated data
A real use case for this is illustrated in the access control example app. The client currently makes a single http request and the server calculates the account balance on demand.
With a ViewModel, the app would make the request to the ViewModel which would be backed by an aggregation (including caluclations) of all the transaction data.
ViewModels
We should support some form of ViewModel. A very simple implementation could depend explicitly on MongoDB. I'm struggling to come up with the exact js API, but the features would be:
A real use case for this is illustrated in the access control example app. The client currently makes a single http request and the server calculates the account balance on demand.
With a ViewModel, the app would make the request to the ViewModel which would be backed by an aggregation (including caluclations) of all the transaction data.