From: Luke O. <lu...@me...> - 2003-11-11 17:30:14
|
> It can do both! > > But you (the people who own the project) need to decide which side of the > wall > to sit on. If you're going to go the superset way, then it needs to be > thought of now rather than later. Just to clarify my email, yes, I agree! Do both, I think it has always been the intent of SQLObject to go both ways (although in my mind, not arbitrary object storage, and never at the expense of python style or relational modelling :). And yes, I've started looking at the objectmatter site to see what might be missing. But as in all opensource projects, who's going to code these things? Someone with the itch. To bring it back to the specific superset issue, I see the following points: a. SQLObject currently stores no information about class relationships (inheritance trees) except for explicit joins/fkeys. b. We currently only directly support what the objectmatter docs describe as a horizontal mapping (as I said, "one complete table per concrete class"). So in order to add the functionality you requested for supersets, two separate pieces: 1. A syntactic method for describing inheritance. Using python class inheritance is the obvious choice. However, that may be overloaded from what we're willing to implement (multiple inheritance?). Alternatively, an extends/derives method, although it feels less obviously pythonic. Along with this comes the syntax and logic necessary to have joins of the Person--*Area type alternatively return subset objects (Homes/Offices), and reverse. (actually, reverse might already work... if you define Area to have a fkey to Person, both Home and Office will as well. yes.) In my mind, this is the OO side of the development (ie, SQLObject would now have conceptual support) 2. Independently, support for vertical mapping. That is, #1 would work with our current method of supporting 'inheritance', this support would allow that syntax and logic to work across specially designated foreignkeys (the Home-->Area key). This is the DB/implementation side of the development (extending the conceptual support to a new db structure). Comments? - Luke |