Live data from Hacker News

(Some) ORM haters do get it

revision-zero.org

1–10 of 108 posts

Re: (Some) ORM haters do get it

#3

The author's claim that ORMs are bad computer science is probably accurate. Fortunately, they're really good engineering.

We could be more subtle, and go with "it depends". For getting and putting data to be used on an edit form, using an object/class which actually has (non relational constraint) "business logic" in it, ORM good. For batch mass update, ORM bad. (one wonders if every table needs a custom class, though)

Re: (Some) ORM haters do get it

#4
Can anyone point out the coup de grâce the author seems to think he has arrived at?

He points out some (well known) ways that ORM's can be used inneficiently, and acknowledges the techniques that have been developed to work around these, but then seems to conclude that he has proven once and for all that ORM's are bad. I totally missed the connection on that part. Is it that SQL is better in dealing with sets than an ORM (a fact no one denies), therefore you should not use an ORM?

Re: (Some) ORM haters do get it

#5
post #3

The author's claim that ORMs are bad computer science is probably accurate. Fortunately, they're really good engineering.

We could be more subtle, and go with "it depends". For getting and putting data to be used on an edit form, using an object/class which actually has (non relational constraint) "business logic" in it, ORM good. For batch mass update, ORM bad. (one wonders if every table needs a custom class, though)

Batch updates aren't where it ends. As a Django developer with a strong SQL background I find my hands are tied far more often than I would like. Sometimes this is caused by bugs like the current group by bug[1], other times it's caused by the design of the ORM.

I do agree that the ORM is handy for things like "Get me all the things in this table", and "update this single record using a form", but this author is dead on. There is logical reason behind the hate developers have for ORMs.

[1] https://code.djangoproject.com/ticket/17144

Re: (Some) ORM haters do get it

#6
There is a need to manipulate relational data from object oriented code. ORMs are tools that facilitate that. The Object/Relational impedance problem doesn't go away if you hand-carve the code, it just makes you work hard on all the points of contact instead of just the problematic ones.

The real "problem" with ORM is when people use such tools as a way of avoiding having to understand databases (and specifically SQL). Fortunately that's becoming less common at least within the Enterprise Java world where I live and breath.

Re: (Some) ORM haters do get it

#7

Can anyone point out the coup de grâce the author seems to think he has arrived at? He points out some (well known) ways that ORM's can be used inneficiently, and acknowledges the techniques that have been developed to work around these, but then seems to conclude that he has proven once and for all that ORM's are bad. I totally missed the connection on that part. Is it that SQL is better in dealing with sets than an…

The connection (according to the author as far as I've understood him) is: "All the techniques that have been developed to work around the inefficiencies of ORMs are just reinventing the wheel. The solutions have been there for 40 years and your workarounds are only needed because you think about individuals (object-orientied) instead of sets (relational)."

Re: (Some) ORM haters do get it

#8

Can anyone point out the coup de grâce the author seems to think he has arrived at? He points out some (well known) ways that ORM's can be used inneficiently, and acknowledges the techniques that have been developed to work around these, but then seems to conclude that he has proven once and for all that ORM's are bad. I totally missed the connection on that part. Is it that SQL is better in dealing with sets than an…

I think his argument is basically the same as the argument that people who put down things like Redis use: You're just slowly recreating SQL. I don't think it's accurate, but that seems to be the argument.

Re: (Some) ORM haters do get it

#9
post #3

Earlier quoted context omitted.

We could be more subtle, and go with "it depends". For getting and putting data to be used on an edit form, using an object/class which actually has (non relational constraint) "business logic" in it, ORM good. For batch mass update, ORM bad. (one wonders if every table needs a custom class, though)

Batch updates aren't where it ends. As a Django developer with a strong SQL background I find my hands are tied far more often than I would like. Sometimes this is caused by bugs like the current group by bug[1], other times it's caused by the design of the ORM. I do agree that the ORM is handy for things like "Get me all the things in this table", and "update this single record using a form", but this author is dead…

Django's ORM is a piece of junk compared to a proper one such as SQLalchemy, hibernate or nhibernate. I wouldn't go drawing conclusions until you've experienced something else.

Re: (Some) ORM haters do get it

#10
I'm well open to correction on this, since I've not much of a clue, but with all this ORM back-and-forth, and relational databases, why do we not see more usage of graph databases?[1] From the wiki, it says they map more directly to OO applications. Is there a reason relational databases are still used by default?

[1] http://en.wikipedia.org/wiki/Graph_database

Post reply on HN