Puzzling OO design problem
Michael Spencer
mahs at telcopartners.com
Sat Apr 9 12:13:28 EDT 2005
George Sakkis wrote:
>
> Nice try, but ideally all boilerplate classes would rather be avoided
> (at least being written explicitly).
It depends on how much magic you are prepared to accept; this goal is somewhat
in conflict with the next one...
Also, it is not obvious in your
> solution why and which placeholder classes have to be written (like
> World2.Movable) and which do not.
It is systematic, if not obvious. You need place holder classes only if you
need to propagate new methods within a given world. More magic would make this
even less obvious.
By the way, my current working
> solution involves copying and pasting verbatim these classes :-)
It appears to be basically the same as mine except you spell out the previous
version explicitly (not that that's bad!)
Have you considered a 'macro' solution composing source? If I were handling so
many versions, I would want a complete class definition for each version rather
than having to scan many sources for each implementation.
Michael
More information about the Python-list
mailing list