From: alexander s. <al...@an...> - 2004-02-17 20:20:17
|
jws...@ra... wrote, at 17.02.2004 21:26: >>(i do not think that you mean "account is a man" inheritance, do you?) > > Actually, I do. oh, please don't! using inheritance ("is-a" relationship) instead of client ("has-a") relationship between classes is highly error-prone and often difficult to refactor later. probably the best paper i've seen on the matter is chapter "Using inheritance well" of the "Object-Oriented Software Construction" book by Bertrand Meyer. this chapter may be downloaded from http://archive.eiffel.com/doc/manuals/technology/oosc/acrobat.html however, SQLObject inheritance won't work in your case anyway: neither is it designed for legacy databases nor can it handle many-to-one relationships. > Since python has multiple inheritance, you can see a parallel between joins > and inheritance. Think of it like a mixin class. Not "account IS a man", > account has the properties of a man. this may mean that both account and man *have* same contact info, or that account *has* a contact person... but as far as i understand, you cannot amend the database structure, so these considerations do not apply. in your case, account has a buyer, and you cannot change that. best wishes, alex. |