There’s nothing wrong with ORM

Rob Conery, apparently bored again, decided to post a rant/whine/something about ORMs, apparently because of something Ayende posted.  Apparently.  It looks like this is a topic that he’s been thinking about for a while, so maybe Ayende’s semi-flamebait post was just the trigger.  I don’t know.  Anyway, Rob posted an initial commentary, and then, because he’s a wuss sensitive soul, he deleted it, and posted an edited commentary.  I have the initial commentary since my RSS reader grabbed it, and I’m not sure exactly why he deleted it, as opposed to just posting a follow up.  I didn’t think it was that obnoxious, but that could be because I use myself as a reference point for what is obnoxious, and, like at least 87% of humanity, Rob is less obnoxious as I am.  I just thought it was, well, kind of dumb.

Anyway, out of laziness and to avoid that evil paraphrasing thing, a few quotations from el Robbo, and my comments:

“Developers are so fixated on data persistence that it’s utterly mind-numbing. I’ll go even further – this fixation on the basics is rusting and corroding the whole .NET coding existence.”

Note the embedded link, it leads to this gem:

“I think, in general, the .NET crowd overthinks and over-engineers just about everything”

It’s hard to know exactly what to say about this, but that’s never stopped me before.  One of the things I prefer about .NET is that it is, in general, depending on what you are looking at, a hell of a lot less over-engineered than, say, Java.  I know there are a lot of lightweight frameworks around now, but seriously, there’s some major suckage there.

Also, the reason why developers think about data persistence is because, oh, I don’t know, maybe because it is often a major business and/or functional requirement.  The non-tech types understand the idea that data sits in tables and you can get to it, read it, and (maybe) do stuff to it.  ORMs exist so that developers can get the data in tables the easiest way possible, without entirely screwing up their day.

Rob knows this, of course, so obviously there is something else on his mind.  Maybe this is it (emphasis in original):

right now there really aren’t any terribly viable solutions that will offer developers the level of familiarity and security that a relational system will – because we haven’t asked for one.”

This, of course, is just nutty.  We do, via ASP.NET MVC, have evidence that there are at least some people at Microsoft who care about what developers think, but in general, software vendors care a lot less about what developers want, and a lot more about what customers want (devs can be customers, of course, but think Venn Diagram and small intersection).  If customers were asking for non-relational systems, Oracle and Microsoft would build them (more on this in a second).

A bit more:

“Using Object storage mechanisms such as a document database or Object database is a great alternative to the ever-present impedance mismatch issue but it clearly needs some proof and testing.”

I’m going to go beyond Rob here, and just state something in the clear:  the ‘ever-present impedance mismatch issue’ is basically a lot of shit.  Is a relational model different from an object model?  Yep.  If you are using an object model and a relational model, will you need to figure out a way to map between the two?  Yep.  Will dumb people f%^k this up?  Yep.  Will smart people sometimes f%&k this up?  If they are ignorant, sure. 

But, at this point, is this really an issue?  Nope.  It’s a solved ‘issue.’  And object databases will never take off unless and until Microsoft and Oracle provide their own solutions.  You can fake it anyway.  Create a table with an ID column, and maybe a version column, then add a column of xml datatype.  Persist your objects to that column.  Done.

Developer friction is, in almost all circumstances, the least important problem.  I have to continue the ‘poor man’s kanban’ series, but if you do a value stream mapping of the entire ‘production line’ involved in your software processes, developer friction isn’t the bottleneck.  Focusing on that is time wasted that could be spent on other things.

This isn’t to say you shouldn’t try to reduce developer friction, or ignore CouchDB, db4o, blah blah blah.  Rock on with all of that.  And Rob will probably end up doing things that are helpful in this area.  He’s good at that.

But, really, ORMs aren’t a problem.  There’s nothing to worry about here.

posted on Tuesday, December 29, 2009 7:20 PM Print
# re: There’s nothing wrong with ORM
Rob Conery
12/29/2009 9:12 PM
Oh blog coward, where would we be without you. I'm very happy to have given you something to write about... it tickles me so.

I must be one of those ignorant types cause I hate diddling with data access. And if you read my post (which I think you admitted you skimmed) you'll notice that I didn't say .NET was over-engineered, I said guys like you like to over-engineer their apps.

Which you do. Then you bitch about it. Then bitch about me bitching about it, and we all have a good laugh.

And your line about focusing on waste being wasteful is a pure gem!
# re: There’s nothing wrong with ORM
12/29/2009 9:50 PM

LOL. I don't think that I over-engineer anything. In fact, I probably under-engineer everything, so you miss on that one.

I read both of your posts (including the one you deleted). Apparently, you don't really have a response to what I wrote, which is fine. Keep on keeping on with CouchDB and see how far that gets you. I'm sure it will get you as far as the Kona re-write, that one went really well.

YMMV. You should think about developing a .NET version of the Ruby ActiveRecord stuff you love so much....oh, wait a minute. LOL.
# re: There’s nothing wrong with ORM
12/29/2009 9:53 PM
This might be one of the least thought out blog posts I have ever read.

Just because ORM has solved the "issue", doesn't mean that that it is the best solution to the problem of data storage.
# re: There’s nothing wrong with ORM
12/29/2009 9:57 PM

What do you think is a better solution?

Given that almost every organization understands data storage in terms of the relation model, what beats it?
# re: There’s nothing wrong with ORM
12/29/2009 10:39 PM
You're conflating two very different ideas: what is a technically superior solution and and what "every organization understands" and coming to the conclusion that because the latter question is answered with relational databases it fits the first question two.

I'm having a hard time figuring out why you would think that having a direct translation from model to persistence would be anything other than awesome. Relational data base theory only came about in 1970, organizations understood data storage very differently before that. The limits of the model are being hit both in scale and programming (NoSql, BigTable, etc.) and a new understanding will almost certainly emerge.

I don't claim to know the answer, but I don't claim the answer has already been found, either.
# re: There’s nothing wrong with ORM
12/29/2009 10:52 PM

I'm not entirely sure what we are disagreeing about here. From a technical perspective, I think BigTable, etc. is great.
# re: There’s nothing wrong with ORM
Joel P.
12/30/2009 9:09 AM
I still understand neither the ORM hype, nor the anti-ORM backlash. In my experience, either my data access is simple enough that coding it myself is not such a hassle, or my objects are far enough removed from the relational model that trying to use an ORM would lead to an exponential increase in complexity.

In short, ORMs seem to be the best fit where they can add the least value. If I've written my persistence layer moderately well, I'll hardly ever touch it again, so how much time can an ORM really save me? But hey, it's a personal choice. If you find your ORM saves you time, maintenance, or project risk, enjoy it.
# re: There’s nothing wrong with ORM
12/30/2009 5:20 PM

There's enough material out there that covers the whole "ORM or not" topic that I think I'll leave that one alone.

I tend to use it as much as I can, and I think I have good reasons for doing so, but I can see why it isn't universal.

Post Comment

Title *
Name *
Comment *  
Please add 6 and 7 and type the answer here: