I am trying to learn Domain Driven Design and recently read that many people are in favor of creating ViewModels for your views, which store all the values โโthat you want to display in this view.
My question is, how should I perform form validation? Should I create separate validation classes for each view or group them together? I am also confused about how this will look in code.
This is how I now think that validation and viewmodels fit into the scheme of things:
View (some user input) -> Controller -> FormValidation (from ViewModel) -> (If a valid map is for ViewModel model for a domain) -> Domain-level service -> Infrastructure
Thanks!
PS I am using Asp.net MVC with C #
validation asp.net-mvc viewmodel domain-driven-design
chobo
source share