[Zope-dev] zope.globalrequest?
Hanno Schlichting
hannosch at hannosch.eu
Fri Jan 16 04:14:22 EST 2009
Christian Theune wrote:
> I noticed 'zope.globalrequest' on the PyPI RSS feed today and wonder
> about it. IMHO this implements an anti-pattern in an official way
> without a warning that this needs to be handled with care.
The discussion for this happened on the plone-dev mailing list. The
reasoning for the functionality is to provide a clean way to get to the
request, without relying on Acquisition. Storing the request in a thread
local is similar to the way other web-frameworks handle this.
The idea is to have this in default Plone and maybe suggest it for
inclusion into Zope2 core. For Zope3 it is certainly not appropriate in
general, as Zope3 has a clear abstraction of request dependent code.
Compared to the available options in Zope2/Plone this approach is seen
as a more practical approach to deal with the (context.REQUEST) pattern.
The original idea of migrating Zope2 to Zope3 approaches in the long
term has failed in my opinion, as not being practically feasible. From a
Plone perspective we now need to think about how to improve and enhance
Zope2 on its own, which might divert from the direction that is
appropriate for Zope3.
The choice of the namespace is up for discussion. We have put a large
amount of packages into the z3c namespace as of late, but I feel a
package that is not meant to be used with Zope3 (though it can) isn't
appropriate for the Zope3Community namespace. The next logical choice is
to put it into the zope namespace which in my opinion stands for "Zope
Community" in its entirety. Inventing a zope2 or z2c namespace is a poor
choice.
Hanno
More information about the Zope-Dev
mailing list