对象关系映射器

编程入门 行业动态 更新时间:2024-10-25 00:28:44
本文介绍了对象关系映射器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我一直在寻找对象关系的世界 mappers,它激发了我对正常表达式上的着名引语 的支持: 你有对象和数据库:这是2个问题。 所以:得到一个对象关系映射器: 现在你有2 ** 3个问题。 也就是说我觉得他们都让我学到了很多关于这个问题的b $ b 或者映射器本身的内部和功能,我会更好地滚动 我自己的查询,根据需要没有 浪费这么多脑细胞。 评论? - Aaron Watters === http:// www.xfeedme/nucular/pydis...nential+growth

解决方案

4月1日下午1:40,Aaron沃特斯< aaron.watt ... @ gmailwrote:

我一直在寻找对象关系世界 mappers和它激发了我在正常表达式上引用了一个名字: "你有对象和数据库:那个''' s 2问题。 所以:得到一个对象关系映射器: 现在你有2 ** 3个问题。 也就是说我觉得他们都让我学习了很多关于 OR映射器本身的内部和功能我最好滚动 我自己根据需要查询没有 浪费这么多脑细胞。 评论? - Aaron Watters === http://www.xfeedme/nucular/pydistro.py/go?FREETEXT =轻度+指数。 ..

你将不得不学习任何OR地图制作工具如何获得 任何东西r从中可以轻松实现,你需要投入并投入时间来学习如何运作。我认为你应该尝试使用一个或两个OR映射器(或者只是使用 SQLAlchemy / Elixir并使用它来完成)与现有数据库和 看看哪个能最有效地完成你需要的东西。如果你到了那些查询过于复杂而无法合理地管理作为python代码的b $ b点,那么是的,使用原始SQL,因为这就是它的内容好的 for。大多数OR映射器都允许你根据需要使用原始SQL。 我认为你所有的选择都会瘫痪很自然,但是 刚开始写一些代码并从那里开始。

Aaron Watters< aa *********** @ gmailwrote:

我一直在寻找对象关系的世界 mappers,它激励我为投入一个支持关于正则表达式的着名引用:

"你有对象和数据库:这是2个问题。 所以:得到一个对象关系映射器: 现在你有2 ** 3个问题。

也就是说我觉得他们都让我学习 这么多内容和功能 或者映射器本身,我会更好地滚动 我自己的查询,根据需要没有 浪费这么多脑细胞。

这是我得出的结论。 当一个棘手的问题出现时,你最终不得不知道无论如何,确切的 要求和底层数据库的行为。然后,一旦你知道你需要发出什么样的命令序列,你必须知道如何说服ORM去做(而不是类似的事情) /> 但巧妙地错了)。在这个阶段,它正在阻碍你。 -M-

4月1日下午5:40 ,Aaron Watters< aaron.watt ... @ gmailwrote:

我一直在寻找对象关系世界 mappers,它激发了我在正常表达式上引用着名的引用: "你有对象和数据库:那是'2个问题。 所以:得到一个对象关系映射器: 现在你有2 ** 3个问题。 也就是说我觉得他们都让我学到了很多关于 OR mapper本身的内部和功能我会更好关闭滚动 根据需要我自己查询没有 浪费这么多脑细胞。 评论?

试试Rails''ActiveRecord。你的问题应该减少到(lg lg 2)^(1/12)。 说真的,你会忘记那里的关系数据库下面。 (那里 甚至是关系列表,树等等的接口) 我不会在这里发布代码示例,这将是异教徒。 :-)

> - Aaron Watters === http://www.xfeedme/nucular/pydistro.py/go?FREETEXT =温和+指数...

I''ve been poking around the world of object-relational mappers and it inspired me to coin a corellary to the the famous quote on regular expressions: "You have objects and a database: that''s 2 problems. So: get an object-relational mapper: now you have 2**3 problems." That is to say I feel that they all make me learn so much about the internals and features of the O-R mapper itself that I would be better off rolling my own queries on an as-needed basis without wasting so many brain cells. comments? -- Aaron Watters === www.xfeedme/nucular/pydis...nential+growth

解决方案

On Apr 1, 1:40 pm, Aaron Watters <aaron.watt...@gmailwrote:

I''ve been poking around the world of object-relational mappers and it inspired me to coin a corellary to the the famous quote on regular expressions: "You have objects and a database: that''s 2 problems. So: get an object-relational mapper: now you have 2**3 problems." That is to say I feel that they all make me learn so much about the internals and features of the O-R mapper itself that I would be better off rolling my own queries on an as-needed basis without wasting so many brain cells. comments? -- Aaron Watters ===www.xfeedme/nucular/pydistro.py/go?FREETEXT=mild+exponenti...

You''re going to have to learn how any of the OR mappers work to get anything reasonable out of them, and you are going to need to commit and invest the time to learn how one works. I would argue that you should try making a prototype using one or two OR mappers (or just use SQLAlchemy/Elixir and be done with it) with your existing database and see which most efficiently does what you need it to. If you get to the point where the queries are getting too complex to reasonably manage as python code, then yeah, use raw SQL because that is what it''s good for. Most OR mappers will allow you to sprinkle in raw SQL as needed. I think it''s natural to be paralyzed by all the choices you have, but just start writing some code and go from there.

Aaron Watters <aa***********@gmailwrote:

I''ve been poking around the world of object-relational mappers and it inspired me to coin a corellary to the the famous quote on regular expressions:

"You have objects and a database: that''s 2 problems. So: get an object-relational mapper: now you have 2**3 problems."

That is to say I feel that they all make me learn so much about the internals and features of the O-R mapper itself that I would be better off rolling my own queries on an as-needed basis without wasting so many brain cells.

That is the conclusion I have come to. When a difficult question comes up, you end up having to know the exact requirements and behaviour of the underlying database anyway. Then once you know what sequence of commands you need to be issued, you have to figure out how to persuade the ORM to do it (and not something similar but subtly wrong). At this stage it''s getting in your way. -M-

On Apr 1, 5:40 pm, Aaron Watters <aaron.watt...@gmailwrote:

I''ve been poking around the world of object-relational mappers and it inspired me to coin a corellary to the the famous quote on regular expressions: "You have objects and a database: that''s 2 problems. So: get an object-relational mapper: now you have 2**3 problems." That is to say I feel that they all make me learn so much about the internals and features of the O-R mapper itself that I would be better off rolling my own queries on an as-needed basis without wasting so many brain cells. comments?

Try Rails'' ActiveRecord. Your problems should reduce to (lg lg 2)^(1/12). Seriously, you''ll forget there''s a relational database below. (there are even intefaces for "relational lists", "trees", etc.) I won''t post a code sample here, it would be heretic. :-)

> -- Aaron Watters ===www.xfeedme/nucular/pydistro.py/go?FREETEXT=mild+exponenti...

更多推荐

对象关系映射器

本文发布于:2023-11-26 17:27:38,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1634507.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:对象   关系   映射器

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!