> In what respect is it flawed? Do you claim that SO is not mature > enough > to handle 5-6 joins via inheritance magic (that's the number of > needed inheritance levels for the program)? Can you comment on > SQLAlchemy > for the same purpose, please? Inheritance is vital for this program.
I can't comment on SA. SO is certainly capable of supporting several levels of inheritance (I think 5-6 is somewhat deep, but that's just IMHO) But the question is what you want to accomplish with your design. The code you showed to me had two classes - BaseSample and BaseData, which are 1:n-related. That they feature a common parent class, Base, was only to add a created column. Now the problem with that approach (in SO at least) is that you will end up joining the table "base" with all queries involving BaseSample and BaseData. It will look like this: select * from base, base_sample, base_data where base.id = base_sample.id and base_data.id = base.id and base.childName = 'BaseSample' and base.childName = 'BaseData' and ... As you can see, the single inheritance scheme used by SO will try and join the base table with _both_ other tables, which doesn't give you the desired results of e.g. getting all BaseDatas for a BaseSample But what you needed of course would be something like this: select * from base base_alias_1, base base_alias_2, base_sample, base_data where base_alias_1.id = base_sample.id and base_data.id = base_alias_2.id and base_alias_1.childName = 'BaseSample' and base_alias_2.childName = 'BaseData' and ... If all you want from Base is to push some common attributes into the tables for each respective class, don't use InheritableSQLObject, just use a "normal" SQLObject. From the python-side of things, this will be the same - but DB-design-wise, it's much more sane. I hope I made my point clear. > > All you want from your base-class is to propagate created-columns > > through your model classes. Joining a common table for that each time is > > a needless waste, and will get in your way soon. > > I think you misunderstood the aim. The shown by svetl three top > classes are > used to derive 10 already implemented classes (out of 30..50 > planned). > Simple duplication of the column definition is definitely not enough. > The three classes were selected to show the problem, not the overall > design. > BTW, your example of a good design only renames Base->car, BaseSample- > > >Mercedes, > > and BaseData->BMW (or do you consider BMW as a subclass of Mercedes? > Wierd > naming to me, and in that case no corresponding class is shown, still > such > classes do exist). My example of "good" design didn't even have BaseData or BaseSample in it. Diez --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TurboGears" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears?hl=en -~----------~----~----~----~------~----~------~--~---

