[Zope] virtual method inheritance/overriding in zope?
Lennart Regebro
lennart@regebro.nu
Mon, 31 Dec 2001 12:01:24 +0100
From: "Roy Mathew" <roymath@yahoo.com>
> My issue is: I would expect that the acquisition mechanism behaves
> akin to the use of virtual methods in Java or regular methods in
> Python (ie: when there are more than one methods/attributes of the
> same name in a hierarchy of classes, then the most derived name takes
> precedence). However, I am finding that this is not the case.
>
> To illustrate, I have a folder hierarchy that contains the following
> DTML files. (I have listed the filenames, and the text of each file
> alongside, since there is only 1 line in each file).
DTML files? Do you mean DTML Documents or DTML Methods?
> To be explicit, rendering /A/x looks as follows:
> this is /x
> this is /y
> this is /A/z
> instead of:
> this is /x
> this is /A/y
> this is /A/z
Ah, you are using DTML Documents. Yes, that is correct. The Documents does
not behave like methods. The Methods do, though. Make x a DTML Method to get
the effect you want.