Friday, March 4, 2011

Thoughts on Entity Framework

I was wondering what people thought about the decision to support Entity Framework over LINQ-to-SQL? I have an application I'm developing originally in LINQ-to-SQL. I found it the perfect solution for our application.

While attempting to port to Entity Framework I was surprised how rough it was. IMHO, not even close to being ready for prime time. No lazy loading, no POCOs, horrible dependency on inheritance. I found it largely unusable in my case and instead decided to stick with LINQ-to-SQL until somehow this Entity Framework can get more polished.

Anyone else have similar experience with it?

From stackoverflow
  • I think it depends on the application platform. When my team set out to create a new ASP.net app, we wanted to go with EF... but after playing around with it for a bit, we went with Linq-To-SQL. In a web environment, managing the L2S datacontext was a lot easier. Also, we liked that L2S entities expose the original Id field (e.g. EmployeeTypeId), unlike EF, which would only have the child entity exposed. In a web environment, a lot of times you really don't need that extra information, the Id is enough because it is a reference to a dropdown list that has already been loaded (and probably cached).

    Jiyosub : Not exposing the IDs was another issue I had. Also, if you wanted to support many to many you had to design a table only with the ids and no other fields or it wouldn't manage the relationship.
  • That is pretty much my view. See my previous reply here. This other question wasn't specifically about the problems in EF, but yes: it has a fair few glitches. For example (in addition to your existing options):

    • no support for Expression.Invoke (re-using expression trees to form a more complex expression)
    • no support for table-UDFs, which can be used to create well-defined, callable methods in the database that are still composable with sort/skip/take etc

    LINQ-to-SQL handles both just fine...

    Richard Szalay : @Marc Gravell Any thoughts on EF4? I'm curious to whether it resolves your issues with the original.
    Marc Gravell : @Richard - I haven't (yet) had the opportunity to re-evaluate.
    Jiyosub : I have moved on to PLINQO to try to make up some of the gap. So for, EF4 doesn't show much improvement.
  • L2S is more mature for what it is made for.

    And I will still consider EF as a BETA realease.

    there is lot of discussion around EF, you can find alot more in related questions.

  • I agree. There are too many bugs and design flaws in Entity Framework v1 (the .net 3.5 SP1 version) to make it usable in real-world development. EFv4 looks more promising though...

  • I've heard that L2S is quickly going the way of the dodo. There is a little bit of chatter about a move to opensource - but the ADO.NET group at Microsoft is planning to push all their efforts towards EF...

    Sad too, because I find Linq2SQL extremely easy to work with and the thought of porting all my code makes me a little sick.

    Update on LINQ to SQL and LINQ to Entities Roadmap

0 comments:

Post a Comment