tags:

views:

589

answers:

3

I've been successful with writing my own SQL access code with a combination of stored procedures and parameterized queries and a little wrapper library I've written to minimize the ADO.NET grunge. This has all worked very well for me in the past and I've been pretty productive with it.

I'm heading into a new project--should I put my old school stuff behind me and dig into an ORM-based solution? (I know there are vast high-concepts differences between NHibernate and EF--I don't want to get into that here. For the sake of argument, let's even lump LINQ with the old-school alternatives.) I'm looking for advice on the real-world application of ORM type stuff against what I know (and know pretty well).

Old-school ADO.NET code or ORM? I'm sure there is a curve--does the curve have an ROI that makes things worthwhile? I'm anxious and willing to learn, but do have a deadline.

Thank you

rp

+1  A: 

I find that LINQ to SQL is much, much faster when I'm prototyping code. It just blows away any other method when I need something now.

But there is a cost. Compared to hand-rolled stored procs, LINQ is slow. Especially if you aren't very careful as seemingly minor changes can suddenly make a single turn into 1+N queries.

My recommendation. Use LINQ to SQL at first, then swtich to procs if you aren't getting the performance you need.

Jonathan Allen
+1  A: 

A good question but a very controversial topic.

This blog post from Frans Bouma from a few years back citing the pros of dynamic SQL (implying ORMs) over stored procedures sparked quite the fiery flame war.

Ray Vega
A: 

There was a great discussion on this topic at DevTeach in Montreal. If you go to this URL: http://www.dotnetrocks.com/default.aspx?showNum=240 you will be able to hear two experts in the field (Ted Neward and Oren Eini) discuss the pros and cons of each approach. Probably the best answer you will find on a subject that has no real definite answer.

Kyle B.
I wish DotNetRocks would interview the person who wrote the System.Data.DataSet and get his/her opinion of ORM. I'm also curious of what functional programmers who using F# or ocaml think of the overhead of ORM.
tyndall