OrmHate
martinfowler.com
OrmHate
1–10 of 136 posts
Re: OrmHate
#2Hating on a tool is ridiculous.
Re: OrmHate
#3That just about sums up my experience with ORMs. Of course, like all things in the real world, experiences vary. However, I do think that generally, ORMs solve none of the difficult relational mapping problems and adds another layer of abstraction that complicates things like performance tuning to the point of negating any other benefits they may bring.
Re: OrmHate
#4For the same reason PHP gets so much hate - both are tools with valid uses, but because they make hard things easier for people, that means that people who have no idea what they're doing can do very bad things. Hating on a tool is ridiculous.
This is not at all analogous to PHP where there is an abundance of alternatives to it's mediocre design. PHP isn't hated because of its concept - a "web-based scripting language". It's hated because it's done very poorly. Just like a lot of bad ORMs Fowler refers to.
Re: OrmHate
#5Re: OrmHate
#6For the same reason PHP gets so much hate - both are tools with valid uses, but because they make hard things easier for people, that means that people who have no idea what they're doing can do very bad things. Hating on a tool is ridiculous.
The core of fowler's article is, "what is the alternative to ORMs?" - and the answer is there isn't much other than rolling your own. This is not at all analogous to PHP where there is an abundance of alternatives to it's mediocre design. PHP isn't hated because of its concept - a "web-based scripting language". It's hated because it's done very poorly. Just like a lot of bad ORMs Fowler refers to.
Re: OrmHate
#7I suspect that context is precisely what underlies the common critiques of ORMs. Those people who best understand the inherent object-relational impedance mismatch tend to be the very people who conclude that the effort isn't worth it.
In my admittedly anecdotal experience, I have found that ORMs are the most useful for the most trivial queries. For anything complicated, I find it easier to drop into SQL and write the query directly than to compose an equivalent object using the ORM - and that becomes increasingly so as the query gets more complicated.
Re: OrmHate
#8The second of those is what I saw at my last job. The tech-lead / architect guy was vehemently anti-ORM... because a previous group (at the same company) had rolled their own ORM in Jython and embedded it into the Java codebase, and it A. didn't perform well and B. was extremely fragile and hard to modify. Now, you can't explain to him that there are well written, productive, performant ORMs like Hibernate. He just doesn't want to hear it. sigh
Re: OrmHate
#9I personally haven't heard/seen anyone griping about ORMs for a couple of years now. I thought the debate was over. Much like you rarely see anyone talk about stored procedures these days.
Re: OrmHate
#10I personally haven't heard/seen anyone griping about ORMs for a couple of years now. I thought the debate was over. Much like you rarely see anyone talk about stored procedures these days.
ORMs fit a very specific use case - eliminating the tedium and risk associated with writing simple queries, and creating a simple layer of abstraction from the database. If you mention ORMs and someone starts griping about how it made their accounting reports slower, slap the shit out of them.