3 ms·
The author's claim that ORMs are bad computer science is probably accurate. Fortunately, they're really good engineering.
by ianterrell 14y ago
The author's claim that ORMs are bad computer science is probably accurate. Fortunately, they're really good engineering.
- Roboprog 14y agoWe 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)
- richardlblair 14y agoBatch 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 https://code.djangoproject.com/ticket/17144
- gouranga 14y agoDjango'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.
- soc88 14y agoIf Hibernate is one of the "proper" ones, then I can happily declare ORMs to be a non-working, time-wasting, over-complicated POS.
- chris_wot 14y agoYour post is of limited value. What, in particular, are the issues that you have with Hibernate?
- chris_wot 14y agoWhat in particular is it about my question that caused it to be voted down? I'm actually very interested in hearing the issues that the responder is having with Hibernate. Unfortunately, because they haven't stated what it is that caused them so many problems, it's of very limited value to the discussion being had.
- gouranga 14y agoI voted you back up. I'm slightly concerned that the down vote was simply retaliatory against the norm which appears to be Common here. I too would like to understand.
- raverbashing 14y agoI unfortunately have to agree wholeheartedly Sure, if you're doing a simple CMS, a simple system (even with Django Auth), Django ORM is fine If you have anything slightly complex (several relationships between models) watch it fall apart
- mb22 14y agoI don't know about the django ORM, however for some other modern ORM's batch operations and statement reordering are one of the top ORM benefits. If you are developing a set of API's that you have no idea how they'll be consumed, the combination of declarative transactions and heuristically optimized ORM based reordered statements + batch updates gives you easy to understand code, proper transaction semantics and really good performance. Without the ORM + declarative transactions you may end up writing ugly apis that pass transactions or connections around and you'll end up having a major task of optimizing the database interactions. Learn your tool, use it for the right use cases and you'll be happy. Putting your left shoe on the right foot will always feel wrong.