Re: [SQLObject] two beginner's questions
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Luke O. <lu...@me...> - 2003-04-29 03:13:38
|
> 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 :) Hmm, I rather more deeply knowledgable about SQLObject's implementation than your own, so rather than puzzle it out myself, care to give a quick overview of the additional things made available by late binding? If you're not dynamically altering the class based on sub/super attribs, and you're mapping to a somewhat normalized set of relations (as opposed to meta-tables of class/attributes or similar), I don't see the difference from an inheritance perspective at least. But like I said, you can probably tell me faster than I can figure it out. Were there other benefits to the late-binding scheme? I'd say the one immediate advantage to the metaclass system is that it seems much easier to introspect on than __getattr__/__setattr__ systems I've seen in the past. I suppose of immediate interest to this thread is how a late-binding system would make implementation-inheritance like the original poster was looking for possible. It still needs to map to some set of tables, the easiest but of least interest to me for an ORM being the meta-table system. (the four primary ways of doing so being mentioned in the Ambler article I linked to; SQLObject takes the route of "Table for each concrete class, and all classes are concrete" :) ) - Luke |