[Zope-CMF] Re: Method Aliases
Shane Hathaway
shane at zope.com
Tue Sep 30 11:24:50 EDT 2003
Yuppie wrote:
> Sure this can't be implemented as efficiently as in Zope 3. But compared
> to all the other inefficient code in Zope 2 and CMF I couldn't measure a
> high cost in speed.
>
> Understandability is something different. Why do you think the current
> implementation is hard to understand? I think it's much simpler than
> what __call__ and view do right now.
Well, I can see you really have your heart in this. During the
formative stages of CMF I wanted to implement almost exactly what you've
implemented, but at the time it wasn't possible to do it without
breaking WebDAV and adding a lot of silly extra machinery. Now there is
__before_publishing_traverse__, which is a cleaner abstraction than
__bobo_traverse__. Maybe it's safe to do this now.
The one thing that's going to trip people is that the method aliases
work only at the highest level, the publisher. In a template, for
example, you can't use "here/edit" to refer to the "edit" method alias.
If I were new to CMF, that would break my expectations--though I don't
know whether it breaks others' expectations.
Zope 3 solves this leaky abstraction by implementing a web publication
layer on top of objects. There is a complete separation of views from
the model. It's not necessarily faster, but it's certainly cleaner and
more understandable, especially now that wrappers are nearly gone.
I guess method aliases are OK, but Zope 3 is already ahead.
Shane
More information about the Zope-CMF
mailing list