开发者

ASP.NET MVC Wizard, WCF and validation

开发者 https://www.devze.com 2022-12-18 10:36 出处:网络
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..

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消