[Zope-dev] zope.globalrequest?

Dieter Maurer dieter at handshake.de
Sun Jan 18 14:12:31 EST 2009


Roger Ineichen wrote at 2009-1-18 13:04 +0100:
> ...
>> 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.
>
>I'm fine with the zope.globalrequest package. But it's very
>important to understand that this is not a common way to do
>things.

Nobody forces you to go this way.

>It also makes the request/interaction etc. a part of the 
>test setup for test components. Probably it simplifies the
>implementation but brings in complexity in test testing
>an application.

We test components nowadays that need a request.

Not much will change when components assume they can get
a request the "zope.globarequest" way. We create a request
object and ensure that it is delivered the "zope.globalrequest" way.

Note that Zope 3 handles the (global) "site" very similar
to the way "zope.globalrequest" handles "request".
This, too, does not make tests impossible (or very difficult).
to the way "zope.globalrequest" handles "request".
This, too, does not make tests impossible (or very difficult).

>I don't say that this is bad in general. I just say that if
>you build an application based on zope.globalrequest, this
>is a totaly different base concept how you will develop
>applications like we do now. And you have to pay the price
>with a complex test setup.

I can live with this complexity :-)



-- 
Dieter


More information about the Zope-Dev mailing list