开发者

Validation a DRY approch

I use Asp.net 4 in C# and Entity Framework 4.

My web application is layerered in this way:

  • Data Access Layer using EF.
  • Business Logic Layer using Class.
  • User View Layer using Web Forms and ObjectDataSource to call BL.

At the moment for Validation I use MS Validation Control son every single Web Form so I can have Client and Server validation.

The main disa开发者_JS百科dvantage for this approach is that I have to insert different Validation Control repeatedly on every Web Form with consequent nightmare in maintaining.

My questions:

  • Do you know a better pattern where I can centralize my Validation Roles and make it work on both Client and Server side?
  • Where would you advice me to insert the logic for Validation? Inside the Business Logic Layer?
  • Can EF POCO help to accomplish this?
  • What about System.ComponentModel.DataAnnotations have you ever used it, What are your thoughts?

Please give me your opinion and some resource if you have any. Thanks for your help!


We use the Validation Application Block from Microsoft;

http://msdn.microsoft.com/en-us/library/ff664356(v=PandP.50).aspx

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜