|
|
|
|
|
by snomad
3058 days ago
|
|
General question for any pros on here, when querying for a read only report, is it standard practice to map from a viewModel/dto to a domain model? Seems a little counter productive to me (for reports) as viewModels will typically have extra concepts foreign to the actual domain model (eg pagination)? Totally get the benefit of DTOs for create / update, but it feels like an unnecessary step in read operations. |
|
But what if you expose domain model to the view, and view changes some property? Are you 100% it will not be saved to db?
If you change one field in a db, do you have to change domain model and UI also?
Important concept is Persistence Ignorance, and how "far" are you willing to go with decoupling application layer from database and domain model. It really depends on your app, and there's no "one correct way of doing this".