ASP.NET MVC Wizard, WCF and validation
I have an asp.net mvc wizard with 5 steps. 开发者_如何学GoMy business model is implemented using DDD. The architecture of the web application is something like this.. View->Controller->WCF->DDD->Repository and Database. Business data validation is implemented in DDD, and WCF makes a call to it to validate data.
I am finding that every step in the wizard I need to call WCF(as part of server side validation) to check if data is valid, and then return result to Controller.
Is this wrong ? Should data validation be part of the model that lives closer to the Controller ? Is there a better solution ?
Data Validaion should remain in the model itself , i this way the validation logic is cetralized , and if you want to change the change the business rules for validation , you need to change it at one place only.
精彩评论