views:

378

answers:

5

Hi I seem to be at an ORM Tool crossroad and would like some advice of people who have faced a similar challenge. In the past I have been using CodeSmith with NetTiers Templates to generate my DAL all has been quite good, however I have decided to drop this for one reason or another.

So I am at a crossroads and have found the following:-

  1. I have looked at PLINQO (Linq to SQL) which seems to do a grand job however with Microsoft uncertain of Linq to SQL this may not be a good choice.
  2. Linq to Entities - This is still in its infancy and I may be wrong but people are complaining about the bloat and how Stored Procedures
  3. I have looked at nHibernate, this maybe the best choice but it seems to be a steep learning curve
  4. Ditto for LLblgen
  5. Subsonic - Not sure about this?
  6. Stick with the tried and tested NetTiers, forget the bloat, forget that you are forced to use the enterprise library, forget the dynamic sql it creates, forget that their is almost no activity on the forums, forget this and use it!

I already own Codesmith and do not wish to purchase anything else, the code generated must work in Medium Trust mode...

There may be others I have missed. I am looking for answers that explain why the ORM Tool is worth looking at.

Thanks Richard

+2  A: 

I used .netTiers myself on the last project. but on the one I'm working at the moment we are trying Linq 2 Entities. You are right about Linq2EF not being mature. We do bitch about it all the time that's why we use T4 templates that generate code from the EDMX file. We also changed those templates so we have Business Objects, Interfaces for injection and DAL + DAO. We are happy to how it works now. The good thing is we can use LINQ against Entities.

Otherwise I'd also suggest Fluent nHibernate (link) to you. It was one of the things we also considered. But you'll have to write lots of things on your own. It's not like you're used to in .netTiers where all the code gets generated for you.

Since Subsonic 3 (link) is just about one week old I suggest you check it out. Based on what I've seen it looks very promising. And it uses T4, so you can slice&dice it to accommodate your needs.

Robert Koritnik
Hi thanks for this, will look at Subsonic and Fluent nHibernate.Another quick Q, you mention T4 templates what are these?Many thanks Richard
Rippo
T4 are the non-menioned capability of Visual Studio. They are templates with code that can generate anything for you.
Robert Koritnik
"But you'll have to write lots of things on your own" I kind a disagree.
Arnis L.
@Arnis: In netTiers all classes get generated for you, as well as stored procedures. And everything inbetween. In FnH you will have to write your own classes and mappings etc. So there is a lot more code writing than in netTiers where you just use CodeSmith that generates everything for you. In netTiers all you have to do is create your database, edit CodeSmith configuration and hit generate. That's it.
Robert Koritnik
A: 

For reasons to use an ORM here's a link to a blog post by Glenn Block which says it all really. As for my experience, just over a year ago I was looking to use an ORM and I chose NHibernate.

Persistance to me is a solved problem, beyond some form of mapping from my domain model to my relational data it is something I don't have to worry about anymore. I looked at Linq To SQL but it just didn't give me enough control over how data was mapped to my objects and the Entity Framework was no where near mature enough for my liking. Another major project some of my team were working on used NetTiers and CodeSmith and like you say, the bloat, code generation (and the sheer amount of it) made me feel a bit quesy. In the end, I chose NHibernate because to me, it is one of the most mature ORMs out there and it provided features that not only would support a finely grained object model, but it has built in querying facilities and it inherently addresses other performance concerns such as caching.

Yes, I will admit that the learning curve is pretty steep but if you invest the time, the benefits you will get out of it are huge. The blogs of Ayende Rahien and Fabio Maulo are a mine of information about NHibernate. There is some LINQ support for NHibernate via this LINQ provider but Steve Strong is currently putting together features which will provide full LINQ support in NHibernate. So it's all go for NHibernate but at the end of the day, it depends what you are most comfortable with.

KnackeredCoder
Your link to a "blog post by Glenn Block" actually links to a blog post by Bill Karwin. It's a great summary of reasons to use ORM.
dthrasher
Changed now to the right blog post. Thanks for the heads up.
KnackeredCoder
+1  A: 

I tried a few for a few weeks and finally settled with NHibernate. It is very easy to customise. There is a learning curve and it takes a little longer to set up that something like linq to sql but the upside of this is that it doesn't seem like magic. You will understand how it works and will be able to customise it exactly to fit your needs. The community is also very good and there is a lot of available documentation. It seems to me to be a good balance between a modern ORM (No code generation, can use POCO's), and maturity.

Jack Ryan
A: 

I Think the two most reputable and strong ORM tools right now are nHibernate and LLBLGen Pro.

nHibernate = Very domain driven oriented.

LLBLGen Pro = Data Driven oriented.

They are both excellent, and for each project depending on it's nature one may be more appropriate over the other. It also frequently comes down to personal choice and preferences or even the development team's culture.

Like I said though In the end, overall they are both excellent and they both have their slight advantages/disadvantages.

Roberto Sebestyen
Thanks Roberto, do you have a list of both advantages/Disadvantages or a link where I can read more....
Rippo
+1  A: 

You could try DataObjects.NET. This ORM uses "Code-first" approach, supports DB schema upgrade and LINQ. Check this brief description http://www.x-tensive.com/Products/DO/.

Alexis Kochetov