ADO.NET Entity Framework 4.3 for Real Web Applications

Play ADO.NET Entity Framework 4.3 for Real Web Applications

The Discussion

  • User profile image


    So, when you use fluent API validations, you are using EF validations, then you are bringing some domain concern to your data acces layer, don't you agree?

  • User profile image
    Adam Tuliper

    Your validation can be kept in separate classes, so not entirely. Validation is often tied to your domain AND your data. Are you going to only have business validation that isn't duplicated in any way in your database? Not likely otherwise you aren't giving nice messages to your users. By the nature of development with db, you have validation rules in your db and your objects that at times duplicate so your domain concerns are really data concerns here that normally make it into the domain as it is.

    If you choose to go with another technology swap out your validation layer. You need some way to tie your validation to the user and/or db as it is, so changing a technology is going to result in some validation related refactoring anyways.

    In the case of EF, you are saying: 'ok, Im getting advantages of having integrated stack for MVC/Web Forms validation coupled with code first if I want it' all while having your validation in separate classes than you pocos, so its easily swapped as well if you choose a different validation mechanism.

Add Your 2 Cents