Re: [SQLObject] two beginner's questions
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Nick <ni...@dd...> - 2003-04-29 03:01:19
|
On Mon, 2003-04-28 at 17:36, Luke Opperman wrote: > Correct, the architecture is a single level of abstraction between a > relational database and python objects. It is a significantly harder > piece of work to map arbitrary inheritance trees to a relational > database, with specific tradeoffs on either the relational or > inheritance/type side of things. I don't think it's really a limitation of the model as much as the implementation. SQLObject sets up properties and functions in a very new class style, which is cool and flexible. You'll notice in the __new__ function of the metaclass how get and set properties are set up, along with assigning other attributes to lambda functions to set up the addX removeX etc. On the other hand, my implementation used __getattr__ and __setattr__ trapping to manage properties very late, at access time. This gives you the flixibility of being able to use inheritance very well, but it does slow down things a bit to have to resolve every attribute every time you access it. What is the goal behind the architecture currently in use vs. the kind I described? A lot of my experience in metaclassing comes from classic classes, so I've learned a lot from the code, but I'm wondering what particular advantages it has over the late binding I'm describing. On the surface it appears to be more limiting, but I'm ready to be enlightened :) Nick |