[ZDP] ZDP-Tools
Maik.Röder
roeder@berg.net
Wed, 09 Feb 2000 14:28:01 +0100
Hi Tom !
Tom Deprez schrieb:
> I'm trying to understand your ZDP-Tools. I see that in all classes you
> define the link_methods & list_methods and others too. Why didn't you just
> created a class which inherits all these from a base class? A base class
> which contains all these general methods?
This base class would be DocumentFolder.
I have tried using the methods from DocumentFolder in the subclasses,
but it did not work.
I get an AttributeError when I delete link_methods & list_methods in
a subclass and use the ones from DocumentFolder.
> This is where object come into. Then you only have to change/add a method
> on the base class and all the childs of this base-class will have the
> new/changed method. Now, when you want to add/change one you've to do it in
> all classes.
You are right generally, but in this special case, I had to make a hack !
The ZClasses have really weird behaviour, and you need all kinds of
workarounds to get what you want.
Greetings,
Maik