4 ms·
> Never understood the hate for ORMs. I need to map from my data storage to my domain model somehow, why write all that code myself This is addressed in the ar
by the_af 5y ago
> Never understood the hate for ORMs. I need to map from my data storage to my domain model somehow, why write all that code myself
This is addressed in the article the title of this one refers to, "The Vietnam of Computer Science" [1]. I really recommend reading it in order to understand why the "obvious" solution is not always the best fit, but the very short summary is: due to the Object-Relational Impedance Mismatch [2], using an ORM can give you headaches and unwanted surprises.
[1] http://blogs.tedneward.com/post/the-vietnam-of-computer-science/ http://blogs.tedneward.com/post/the-vietnam-of-computer-scie...
[2] https://en.wikipedia.org/wiki/Object%E2%80%93relational_impedance_mismatch https://en.wikipedia.org/wiki/Object%E2%80%93relational_impe...
- makeitdouble 5y agoWent to most of the article, and it seemed to boil down to this kind of reflection: > But as time progresses, it’s only natural that a well-trained object-oriented developer will seek to leverage inheritance in the object system, and seek ways to do the same in the relational model. Basically, things are not perfect, and people try to blindly apply layers upon layers, thus getting deeper and deeper into a quagmire. But the proposed solution of applying no automated layer doesn’t compute. If he can restrain himself from using any ORM at all, why can’t he restrain himself from adding inheritance in ORM models or other “let’s OOP this to death” blind approach ? This feels like the “I sometimes get drunk so I’ll build a whole support structure to stop me from drinking”, and at no point someone steps in to say “just be moderate and it will be fine”
- nauticacom 5y agoIt's no wonder this article was written in 2006. One of the problems describes DBAs! Has anyone heard of a DBA in the last decade? Most of these other problems are just... solved? Any decent language will let you override the meaning of equality between two objects, if you don't use a ton of inheritance the inheritance problem won't bite you, good libraries let you describe the schema once and either generate SQL or generate classes, etc.
- the_af 5y agoTwo years ago I worked at a company with a DBA team. In my current job, there are no database experts and people don't understand things like indexes. In my experience, most developers don't understand databases (of any kind). So I'd say none of the problems from that article are really solved.
- avgcorrection 5y agoMaybe the original author never read Chomsky. https://chomsky.info/198210__/ https://chomsky.info/198210__/
- the_af 5y agoThanks for posting it. I knew Chomsky's position (that the US involvement in Vietnam was actually a war against South Vietnam, with North Vietnam as the excuse) but had never taken the time to actually read this interview in detail. Yes, this makes the whole ORM analogy fall apart, because it's based on a misconception. But I think the analogy still works when using the popular understanding of that war as the comparison.