views:

332

answers:

6

I was surprised to find a public letter proposing a vote of no confidence in the entity framework (see http://efvote.wufoo.com/forms/ado-net-entity-framework-vote-of-no-confidence/)

Would the reasons stated in the letter keep you from using the current version of the entity framework? Would you rather wait for v4.0? Or rather use another ORM?

+3  A: 

Another ORM.

Don't get me wrong you should get flamed with responses, but currently only nHibernate is functionally complete.

I'm a TDD fan, so want an easily testable POCO ORM solution. If that's your bag then EF3.5 is out. EF4.0 is introducing it (http://blogs.msdn.com/adonet/archive/2009/05/21/poco-in-the-entity-framework-part-1-the-experience.aspx) , but it still has at least 1 big drawback -> doesn't support inheritance.

NHibernate is more complete, but EF could be easier to use. As ever, best tool for the job... but if it's an Enterprise-scale TDD developed app, go nHibernate.

Also -> there's a profiler that makes nHibernate dev much easier -> http://www.nhprof.com/

ip
I beg to differ - it's not just another ORM. It's way more than anything NHibernate offers - it's a complete decoupling of your domain object model (conceptual) from the underlying storage (database) model.
marc_s
+3  A: 

I tried using it for my current project, which basically involves rewriting our current mess of a data layer.

It just doesn't work.

First, if you're trying to base an Entity off of a View, the designer tries to force every NOT NULL property to be an entity key... which is pretty much never what I wanted. To work around that you have to edit the xml in at least two places, and do it every time you add an object because it refreshes and re-adds the EntityKey properties. http://stackoverflow.com/questions/941826/must-specify-mapping-for-all-key-properties-in-entity-framework

Second, when you are creating associations you MUST use every entity key - http://stackoverflow.com/questions/946578/how-can-you-make-an-association-without-using-all-entity-keys-in-entity-framework

Those two things held me up for 3 days, then I went back to Linq to SQL and had it done in a couple hours. (Well, at least the part of the system I was struggling with... ) I don't know if those are in the Vote of No Confidence, but it's just not ready in my opinion.

Also with the lack of answers I got here on every EF question I've asked, I have to assume current usage is so low that getting help and support is going to be difficult... which is possibly the BIGGEST reason not to use something.

Let's hope the next version is better...

EDIT: OUr current plan is to stick with Linq 2 SQL (I have to finish a project by Friday) and then evaluate all the other ORMs to see if anything else is better. The other developer hates L2S for the record, but I've never had any major problems using it...

Telos
+4  A: 

The current version of EF is definitely not perfect, and has lots of gotchas and drawbacks. I probably wouldn't use it right now - but the upgrade path to EF v2 (or is it EF4?) sure looks pretty rosy!

  • complete persistence ignorance - you can use your straight up POCO classes
  • deferred loading configurable as an option
  • much improved designer with support for pluralization/singularization (even in multiple languages!)
  • ability to do "domain first" design and create database from your model
  • ability to have self-tracking entities across multiple layers that allow you to send data to the client and get back changes and apply them to your entity context

All in all, EF v2 looks very promising and I'm very eager to give it a serious spin. If it really keeps all the promises out there right now, it's definitely a winner!

Check out the ADO.NET team blog for a flurry of recent blog posts on EF v2.

Marc

marc_s
@Marc Does the self tracking entities also work on POCOs or do you have to roll your own solution for this (original version,current version, database version) in N-tier solutions?
WeNeedAnswers
+2  A: 

EF has some rich design time support, but I have to agree that nHibernate is the way to go, despite the learning curve. If you need to make something fast and don't care about TDD or serialization (which is a large weakness of all of MS's ORM offerings) go EF.

marr75
A: 

I have developed my own FREE ORM C# Code generator. It generates business components, entity object and data components and uses sql data readers for optimal performance.

The tool is called FrameworkGen and can be downloaded from http://www.elencysolutions.co.uk.

There are some perfomance benchmarks on the site comparing FrameworkGen to Linq to Sql and the ADO.Net Entity Framework.

CroweMan
A: 

Well My experience of Version 1 was interesting. I wanted to use POCOs but it didn't support it. After reading around I came across some code from a bod at microsoft that did this.

It was a bit messy to generate the code but on the whole this part of the process was not so bad.

A real nasty part that I came across was the lack of Concurrency checking built in, for N-tier development. You have to manage this yourself which after looking at the problem was not so bad, especially if you want to hand back the versioning back to the client for user intervention.

Second nasty and absolutely stupid thing missing was the IN keyword for LINQ queries. Not supported and so needs to be worked around. I found a solution but was a real mess bringing in some other code that quickly patched up the omissions.

Would I use EF 4.0 (2.0). Yes, absolutely, why not? In fact on stage 2 I will be using this. It looks like it supports POCOs, it looks like my concurrency model will move straight across with no problems (basically delta copy stuff). Its all good so far and I hope this time round that the Big guys at Microsoft have seen the errors of their ways and provided a solution that works.

If your buying into entity development and the whole Concept Model first thing, then its the only way to go for a complete Microsoft solution. Although the stuff being done on the M language might eclipse the idea and move the whole modelling thing back to the Database.

If you not buying into the Entity stuff then I would strongly go Enterprise Library. Its a proven technology that works every time built on a solid code foundation and Database centric paradigm. I would also go this route if you think that Stored Procedures are the bees knees and like what they bring to the table.

If your feeling really exotic and feel a bit frisky I would go with a NO-SQL approach such as CouchDB. This however does take some getting used to. Its damn weird and feels really really wrong. But things get developed in super quick time and the solutions seem to be robust and faster than expected. I would not got for this type of solution though if your big into Normalization and think that it can be applied to a NO-SQL approach. The whole model needs to be shifted on its head and the application will be needed to be modelled in a way that is driven by the technology applied.

I find the CouchDB way a bit dirty and very very wrong. But it has so many compelling reasons to use it, that I think it will seep into the psyche of every programmer, and it will definitely go mainstream in the next couple of years.

My biggest gripe still with the whole Entity thing though even in the new version 4 is that there really has not been much thought into N-tier environments. It still got a feel about it being a 2 tier solution with a lot of boiler plate code still needed to be done by the end user (developer), to get it working in a robust and dependable N-Tier way.

WeNeedAnswers

related questions