是ORM仍然是“越南的计算机科学”? [英] Is ORM still the "Vietnam of Computer Science"?

查看:231
本文介绍了是ORM仍然是“越南的计算机科学”?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我昨天晚上阅读了这篇文章,我注意到这是从2006年。我可以去ORM,数据库事情,但我只是想知道,如果一切坏的Jeff说关于ORM仍然适用,即使现在考虑的职位是从2006年。



甚至比OO软件,如果数据库没有按照预期的方式进行处理,数据库也会受到影响。这不是你应该介入一些抽象层在它的前面。



我认为不可渗透的抽象层试图建立一个乐高城堡与所有的关闭成一个枕套。 SQL很难做到正确。它不与过程编程共享许多模式,一个的最佳实践可能与另一个的相反。你需要能够在SQL语句中搜索每个单独的项目,并且有一个很好的想法是什么,它实际上是做什么。



很多的人似乎认为,像马蹄铁,关闭是足够好的 - 如果正确的答案弹出,这意味着你几乎在那里。在SQL中,这根本不是真的。



RoR和ActiveRecord模式因为这个原因值得称为dbms资源池。优化的ActiveRecord设计往往不是次优的SQL设计,因为它鼓励SQL语句分解。


I read this post last night, and I noticed it was from 2006. I could go either way on the ORM, database thing, but I was just wondering if everything bad Jeff said about ORM still applies even now considering the post is from 2006.

解决方案

It's still true.

Even more than OO software, the database suffers if it isn't treated precisely the way intended. And it wasn't intended that you should interpose some abstraction layer in front of it.

I think of impermeable abstraction layers as trying to build a Lego castle with all the pieces closed up into a pillowcase. SQL is damn hard to do correctly. It doesn't share many patterns with procedural programming, and best practices for one can be the opposite for the other. You need to be able to grok every single item in a SQL statement, and have a pretty good idea what it's intended to do, and what it in fact does.

Lots of people seem to think that, like horseshoes, close is good enough - if the right answer pops out, that implies you're nearly there. In SQL, that's simply not true.

RoR and the ActiveRecord pattern have deservedly earned a reputation as dbms resource hogs for this reason. Optimized ActiveRecord design is more often than not suboptimal SQL design, because it encourages SQL statement decomposition.

这篇关于是ORM仍然是“越南的计算机科学”?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆