Confused about class relationships
Craig Allen
callen314 at gmail.com
Tue Dec 2 15:44:10 EST 2008
what you have is a totally acceptable factory system. Not sure why
you are using a generator, but that's another matter.
I agree with the previous replies regarding inheritance... this is not
a case for inheritance. You could, however, have Bar be a borg with
the Bar factory built in as a class method to the Bar class itself if
you want the whole job done by one component. Questions to lead to or
away from that: will Engine every create things besides Bars?
More information about the Python-list
mailing list