-----BEGIN PGP SIGNED MESSAGE-----
On 6 Jan 2007, at 16:03, Martin Aspeli wrote:
I would say it's very bad if we need to train people on when aq-
wrapping tools (using __of__() say) is required and when it's not.
In fact, I'd say its catastrophic and will break incredible amounts
of existing code.
If getToolByName() keps aq wrapping, though, then legacy code
shouldn't be affected, so it's only new code using getUtility().
getToolByName does explicitly wrap, even when using getUtility under
the covers where it can. I don't forsee any compatibility problems
In this case, we probably need to fix the tools themselves so that
they don't depend on being aq-wrapped. Actually, Hanno's suggestion
is kind of neat. Let the persistent portal object be a (the only)
utility providing ISiteRoot in the local utility registry, and when
tools need to get the portal, root, do:
portal = getUtility(ISiteRoot)
I guess it's rare that we'd want to acquire anything from above the
portal in a tool (user folders being the only thing I can think of).
The portal as utility is a good idea, I like it. This could be used
in many places where a tool itself wants to acquire something, which
is usually something else at the portal root. I'm not sure about the
user folder implications that you mention. The security machinery may
fail if a user originates in a user folder above the portal, which
cannot be reached by acquisition anymore.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)
-----END PGP SIGNATURE-----
Zope-CMF maillist - Zope-CMF@lists.zope.org
See http://collector.zope.org/CMF for bug reports and feature requests