Rocky wrote:
On Apr 18, 6:17 pm, Martin Aspeli <[EMAIL PROTECTED]> wrote:
Come to think of it, Five's implementation of the <browser:page />
directive injects its BrowserView class as a base class of your class.
This is bad voodoo magic, though. It's going to happen. You need it. So
be explicit about it. :)

Yes/no/maybe.  I agree that this directive is probably doing more than
it should be doing.  But ... having the magical aq security machinery
work is already fairly implicit in the zope2 world.  I typically do
"class MyView(object)" in order to treat it more like an adapter.  How
often do you extend conventional base classes when creating new non-
view-style adapters?  So in this case Five is injecting things for the
view to behave better on Zope 2 (including allowing security to
work).  I don't know... I'm still fairly torn on this issue.

Do you also do

implements(IBrowserView)

... which you'd otherwise get from the base class, by way of zope.publisher.browser.BrowserView?

Again, you'll get this with ZCML injection, but it's silly not to be explicit about that. Someone reading your code should be able to understand what interfaces are being provided and what base classes are being involved.

Martin


_______________________________________________
Product-Developers mailing list
Product-Developers@lists.plone.org
http://lists.plone.org/mailman/listinfo/product-developers

Reply via email to