I'm looking at evaluating ORMs.
I've used SubSonic, Linq-to-SQL and Entity Framework. I've got a team of developers ranging from juniors to seniors.
What are the criterias for evaluating an ORM for.NET?
|
I'm looking at evaluating ORMs. I've used SubSonic, Linq-to-SQL and Entity Framework. I've got a team of developers ranging from juniors to seniors. What are the criterias for evaluating an ORM for.NET? |
|||||||||||||||||
|
|
It's a loaded question. What you should ask yourself when selecting an ORM:
A few ORMs that I looked at:
There are many others of course. You can have a look at the controversial site ORM Battle that lists some performance benchmarks, although you have to be aware that raw speed is not necessarily the most important factor for your project and that the producers of the website is DataObject.Net. |
|||||||||||||||
|
|
ECO :) It is much more than an ORM while including state machines and executable OCL (namely EAL) supports. There exists a free version with a 12 domain classes limitation which I think should be pretty neat for small projects. |
|||||
|
|
I'm using NHibernate and have found it pretty good. In my case, linked to an MS Sql database, but you can connect to other databases. It doesn't take long to get up and running - just map your object to the model - I use an xml file but you can do it fluently in code. There's a great community, and personally I have found Ayende's work to be very helpful - I use NHProf which is an sql profiling tool. I mostly use the out of the box functions - straight object mapping, but I've also use the Hibernate Query Language, which is pretty easy to get a hold of. |
|||||||||||||
|
|
Sadly, in my last three jobs, we had three home-grown ORMs. In each case, they mostly sucked for varying reasons. I have recently been evaluating Entity Framework 4 and its POCO support (a nice walkthrough is here) and am really impressed at how nicely it stays out of my face and makes me feel like I'm programming again rather than herding data. |
|||||||||
|
|
I would advise you to have a look at DevExpress XPO. This along with DevExpress XAF will make life of any developer easy once its learning curve is crossed. |
|||||||||||
|
|
There isn't a "best" ORM framework because they all have different combinations of strengths and weaknesses and it tends to be the case that if developers choose to focus on making one area better there are other areas that suffer in comparison (code first vs model first vs database first). There are, on the other hand, a number of very good ones some of which will be a better match to your personal circumstances and philosophy than others. Edit: For what its worth, I'm currently using Linq to SQL - mostly because its there though partly because it does a lot right for minimal effort and will probably progress to Entity Framework again "because its there" (though similarly there is also a lot about EF4 that's right as well as some stuff that's wrong). The concern, especially with the latter, would have to be performance but for most of my cases that's not a huge issue and the ability to run Dynamic Data and OData from the models (L2S and EF) has considerable benefits for me in terms of "cheap" wins. |
|||||
|
|
I like Linq to Sql a lot. It's simple and has a decent designer. However, I hope to end of life it in favor of Entity framework. I would like to be able to leverage the ability to modify the generators so that I can have customized objects. The biggest benefit that these have over others (in my opinion) is that they are out of the box with VS. This is also a negative in that you are at the mercy of MS (see Linq to Sql). |
||||
|
|
|
We use NHibernate + Fluent NHibernate, with Linq-to-Sql on small projects. The reason for this is: 1) (Not the primary reason) NHibernate seems to have a higher "respect" factor amongst developers (is this true?), 2) Compared to linq-to-SQL, nHibernate allows ORM mapping between Db objects and entities which don't map 1-to-1, 3) We haven't extensively compared nHibernate to Entity Framework 4.0 but here's a good comparison: http://ayende.com/blog/archive/2010/01/05/nhibernate-vs.-entity-framework-4.0.aspx nHibernate does have somewhat of a steep learning curve and its XML maps can be quite verbose, but start with with the Fluent Nhibernate site documentation and work your way backwards. |
|||
|
|
|
|
||||
|
|
|
We've had good luck with Entity Framework. Our situation is somewhat unusual, though -- we do data collection for the reporting team, so they actually design the database. We get the DB and then just use EF to generate the data access classes from it. Works great for us, but we just do bulk data loads, so I can't vouch for how well it does in a more transactional environment. |
|||||
|
|
NHibernate (+ FluentNHibernate) would be the default option for me. It is very flexible, extensible and robust. It's got a huge amount of users and it's very actively maintained. The downside is the steep learning curve. MindScape's LightSpeed is simple and user friendly, but still fairly flexible and capable. It has a designer surface like L2S/EF and a UnitOfWork implementation. |
|||
|
|
|
[DISCLAIMER: I work for DevExpress] You can see screenshots of typical applications created by DevExpress application frameworks here. This page also contains a very brief review of our products. For more detailed information on why, I suggest you check out respective product pages on our web site. As for DevExpress XAF and XPO, here is a good explanation on why to choose our application frameworks. Plus, we provide support and documentation, which is also important and worth mentioning. Feel free to contact us in case of any questions. |
||||
|
|
|
Well, there is no "best" choice but I would say that regular old Linq to SQL meets your needs. It's not a "true" ORM per se, but it's very lightweight and gives you the flexibility to write code without being aware of it, if that makes sense. What I mean is that you can continue writing code as normal, without having to really be aware of Linq other than having the Entity Framework is a bit heavy, and while I've only dabbled with it a little bit it's more "in your face" than basic Linq to Sql, but EF is much more of a true ORM than Linq. I would look at all of the criteria you are looking for in an ORM. Is it just because you want to avoid having to write raw SQL or, worse, have hundreds of Stored Procedures? Do you need some extra features that raw Linq to Sql can't provide? You need to answer those questions, but based on your brief requirement ("lightweight and easy to use") I think Linq is slightly easier than something like Subsonic, and is built-in to Visual Studio. |
|||
|
|