[Zope] virtual method inheritance/overriding in zope?
Roy Mathew
roymath@yahoo.com
Sun, 30 Dec 2001 18:53:34 -0800 (PST)
Dear Zope users.
I have what seems to be a very simple issue, and yet reading the FAQ
didn't seem to help, and digging thru the archives wasn't very helpful
either, so here goes.
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).
/x "this is /x\n<dtml-var y>\n<dtml-var z>"
/y "this is /y"
/A/y "this is /A/y"
/A/z "this is /A/z"
Notice that my intent is to override the contents of /y with /A/y when
referencing the URL /A/x. Instead, I find that it is /y that gets
picked up in place of /A/y.
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
Doesn't this make it harder than necessary to come up with a file
structure that promotes reuse (file "x" in this case)? Is there some
fundamental issue with the acquisition mechanism that simply precludes
such virtual attribute/method inheritance?
Please reply to "roymath@yahoo.com", since I am not yet on the mailing list.
Thanks,
Roy.
__________________________________________________
Do You Yahoo!?
Send your FREE holiday greetings online!
http://greetings.yahoo.com