对象关系映射器 [英] object-relational mappers

查看:73
本文介绍了对象关系映射器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在寻找对象关系的世界

mappers,它激发了我对正常表达式上的着名引语

的支持:


你有对象和数据库:这是2个问题。

所以:得到一个对象关系映射器:

现在你有2 ** 3个问题。


也就是说我觉得他们都让我学到了很多关于这个问题的b $ b

或者映射器本身的内部和功能,我会更好地滚动

我自己的查询,根据需要没有

浪费这么多脑细胞。


评论?


- Aaron Watters


===
http:// www.xfeedme.com/nucular/pydis...nential+growth

解决方案

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


我一直在寻找对象关系世界

mappers和它激发了我在正常表达式上引用了一个名字:


"你有对象和数据库:那个''' s 2问题。

所以:得到一个对象关系映射器:

现在你有2 ** 3个问题。


也就是说我觉得他们都让我学习了很多关于

OR映射器本身的内部和功能我最好滚动

我自己根据需要查询没有

浪费这么多脑细胞。


评论?


- Aaron Watters


=== http://www.xfeedme.com/nucular/pydistro.py/go?FREETEXT =轻度+指数。 ..



你将不得不学习任何OR地图制作工具如何获得

任何东西r从中可以轻松实现,你需要投入
并投入时间来学习如何运作。我认为你应该尝试使用一个或两个OR映射器(或者只是使用

SQLAlchemy / Elixir并使用它来完成)与现有数据库和

看看哪个能最有效地完成你需要的东西。如果你到了那些查询过于复杂而无法合理地管理作为python代码的b $ b点,那么是的,使用原始SQL,因为这就是它的内容好的

for。大多数OR映射器都允许你根据需要使用原始SQL。


我认为你所有的选择都会瘫痪很自然,但是

刚开始写一些代码并从那里开始。


Aaron Watters< aa *********** @ gmail.comwrote:


我一直在寻找对象关系的世界

mappers,它激励我为
投入一个支持
关于正则表达式的着名引用:


"你有对象和数据库:这是2个问题。

所以:得到一个对象关系映射器:

现在你有2 ** 3个问题。


也就是说我觉得他们都让我学习

这么多内容和功能

或者映射器本身,我会更好地滚动

我自己的查询,根据需要没有

浪费这么多脑细胞。



这是我得出的结论。


当一个棘手的问题出现时,你最终不得不知道无论如何,确切的

要求和底层数据库的行为。然后,一旦你知道你需要发出什么样的命令序列,你必须知道如何说服ORM去做(而不是类似的事情) />
但巧妙地错了)。在这个阶段,它正在阻碍你。


-M-


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


我一直在寻找对象关系世界

mappers,它激发了我在正常表达式上引用着名的引用:


"你有对象和数据库:那是'2个问题。

所以:得到一个对象关系映射器:

现在你有2 ** 3个问题。

也就是说我觉得他们都让我学到了很多关于

OR mapper本身的内部和功能我会更好关闭滚动

根据需要我自己查询没有

浪费这么多脑细胞。


评论?



试试Rails''ActiveRecord。你的问题应该减少到(lg lg

2)^(1/12)。


说真的,你会忘记那里的关系数据库下面。 (那里

甚至是关系列表,树等等的接口)


我不会在这里发布代码示例,这将是异教徒。


:-)


>

- Aaron Watters


=== http://www.xfeedme.com/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

===
http://www.xfeedme.com/nucular/pydis...nential+growth

解决方案

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

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

===http://www.xfeedme.com/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***********@gmail.comwrote:

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...@gmail.comwrote:

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

===http://www.xfeedme.com/nucular/pydistro.py/go?FREETEXT=mild+exponenti...


这篇关于对象关系映射器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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