views:

9922

answers:

9

So the ADO.NET Entity Framework has gotten a little bit of bad press (in the form of blog entries and a petition) but I don't want to rush to judgement. I'm limited in time for experimentation but I was wondering has anyone worked with it yet with more empirical feedback?

Finally, what are thoughts on using NHibernate which has been around for a long time and may be more mature than the ADO.NET Entity Framework.

+11  A: 

I haven't tried EF, but I have tried NHibernate. And with that, I can say the absolute best ORM I've ever used is SubSonic. SubSonic's single greatest feature is convention over configuration. You have to do almost zero configuration so getting up & running is very speedy. Check out the plethora of videos on the site.


This got down voted? Man ... haters.

xanadont
Interesting. At the time you wrote this, Fluent was not yet ready. But Fluent does for NHibernate what SubSonic does for you: convention over configuration. But in the end it depends of domain of usage which tool fits best and with legacy mapping (can hardly be well used with conventions), NHibernate does the drill better then any I've seen any (commercial) ORM.
Abel
+2  A: 

Microsoft have all but admitted that the ADO.Net Entity Framework isn't an ORM (I can't find a reference currently). So if you think of the Entity Framework as a query engine then apparently it is really good at what it does. For a complete ORM solution you might want to look elsewhere however.

The following blog post seems to bear out this difference:

http://blogs.msdn.com/dsimmons/archive/2008/05/17/why-use-the-entity-framework.aspx

samjudson
+6  A: 

NHibernate may be more mature. That does not necessarily mean it is a "better" solution. Having used it at my job for some time, I would personally prefer to use almost anything than NHibernate (even straight SQL, if migration were remotely feasible). The number of error messages thrown by NHibernate that don't mean anything (or that do mean something but should never occur) is absolutely staggering, as are some of its default behaviours (such as flushing the session once for each object returned in a Find).

Personally, when I have a choice, I use LINQ to SQL for all database work.

DannySmurf
does the subsiding support recently spouted about in the 'sphere make you question this decision? i feel as though i needed to abandon it for fear that future needs for support would be ignored by ms. thoughts?
brady gaster
I'm not terribly concerned. If it's abandoned completely (unlikely), it's always possible for a third party to build a LINQ to SQL layer ontop of plain LINQ (which is not going anywhere), similar to the groups that did LINQ to AD or LINQ to NHibernate. Someone would almost certainly do this.
DannySmurf
What errors are you getting?
Mauricio Scheffer
My favourite one is "expected affected row count: 1, actual affected row count: 0," without an explanation or even a table name. There are lots more, but that one's fairly demonstrative.
DannySmurf
A: 

I do have a problem with SubSonic. SubSonic choked to death on tables with same name but different schema. I don't want to discuss the best practices of building a database, because I did not make the call to do so.( When it comes to raise voice make a point and keep the job, I'd rather keep my job. :) )

That's a good insight - where I work someone designed a database in the same way with duplicated names across multiple schemas.
David in Dakota
A: 

I've used SubSonic, LinqToSql, LinqToEntities. Now i'm trying NHibernate. For now - i like NHibernate (probably cause i haven`t met problems enough). Worst of them all - LinqToEntities (that's only my opinion, of course).

Arnis L.
A: 

I am coming around to liking Entity. It takes a while to figure out what all of its error messages mean but once you get used to it it really does a great job. The biggest drawback it has right now is no real support for going disconnected.

MvcCmsJon
+1  A: 

"I haven't tried EF, but I have tried NHibernate. And with that, I can say the absolute best ORM I've ever used is SubSonic. SubSonic's single greatest feature is convention over configuration. You have to do almost zero configuration so getting up & running is very speedy. Check out the plethora of videos on the site. "

It is absolutely wrong. Did you try Subsonic with Oracle? It can be sadden for use it. And it is a code generator not ORM.

+4  A: 

If zero configuration is main advantage of SubSonic you can look at Fluent nHibernate

Regfor
A: 

I hear mixed comments on Linq to SQL. I found that it could not be used disconnected because it was completely unable to reconnect to the context. Someone above said that entity framework cannot go disconnected either. Lets get real, disconnected is critical for web applications.

Has anyone got any wisdom about nHibernate and SubSonic for disconnected applications?

John Thompson
As far as L2S goes, disconnected is a non-issue. If you get an object from the database with a DataContext, that same DC needs to be used to commit it back. You only have trouble if you use multiple DataContexts. Say you pull an object and display it on a webpage. A user makes some changes and submits it back. You then pull the object from the database again, verify its data version is the same as what you showed the user, apply your changes, and commit. Understanding the unit-of-work pattern is essential for L2S. As long as you don't try to make your L2S objects into entities, you're golden.
mattmc3