tags:

views:

401

answers:

3

Duplicate:

Are there good reasons not to use an ORM?


We have all heard the reasons for using an orm. What are your reasons for NOT using an ORM?

I am an ORM believer, but as a consultant I find that ORM usage is actually very low -- which is strange to me. Many shops refuse to use them, and actively tell their employees not to use them (I guess their stored proc are all they need).

+5  A: 

I can't put it any better than Ted Neward has.

TML
On an amusing side note, it looks as if Ted had lost his article and 'restored' it by pasting the Google cache into his CMS. :)
TML
+1 for his comments... but too damn long to read
Matthew Whited
It seems like his arguments for not using ORM are already known to those that use them, yet he really doesn't provide much in the way of resolution to the problems he states, let alone his specious parallels to ORM and Vietnam. It would have been much more effective had he skipped the political aspects of any given technology and presented solutions to the problem. There is an obvious modeling issue between OO and relational data, but the given state of ORM technology solves much more problems than it actually creates.
Wayne Hartman
+8  A: 

I use ORMs for DB transactions that will have little overhead anyway; simple, atomic CRUD tasks that don't occur multiple times a second for example. However, when you have a large query that requires many joins and parameters and will return a potentially large dataset, you really need to get down to the SQL level to fine tune it to get the exact data you need and to make sure the query is optimized.

Frank Rosario
+2  A: 

There is pretty good reason to not use one if the application is dealing with lots of bulk importing and exporting of data. This functionality is now being provided by some ORMs and it is improving but it is still measurably slower than doing it manually.

Not using one will probably decrease developer productivity but if the solution requires the best possible bulk data performance, that is one of the costs.

Steven Lyons
Your second statement makes me smile. If solving problems decreases productivity, I want to be the least productive developer, so I get to actually solve problems, instead of regurgitate patterns!
Tom
Very true, Tom. I choose solutions over patterns. But, for example, needing to have validation rules in multiple places in order to maximize speed is always a headache, especially for those left to support the code.
Steven Lyons