Hi, Am Samstag, den 17.01.2009, 11:36 +0000 schrieb Martin Aspeli:
Dieter Maurer wrote:
Christian Theune wrote at 2009-1-16 09:06 +0100:
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.
IMHO, it is not an anti-pattern:
We have a global "site" why should we not have a global request?
When Zope is used as a Web Application Server, it is quite natural to expect a request.
+1 +1 as well
However, there is a definite risk with it as well of encouraging poor separation of concerns. If code is dependent on a request it's not re-usable outside the web container. For views or web app controllers, that's certainly fine, but if you're writing something more generic, then it may be better to have the discipline to pass objects around that properly abstract your data, rather than assume you can access the request willy-nilly.
Isn't there always the risk that people design software the "wrong" way?
This is a documentation issue, though.
Martin
Robert