[Zope-CMF] Re: [dev] five.localsitemanager: proposal

Hanno Schlichting plone at hannosch.info
Mon Jun 18 05:30:38 EDT 2007


Hi,

yuppie wrote:
> Yesterday I tried to do my homework from the CMF-mini-sprint in Potsdam.
> I reread the tools-as-utilities discussion and had again a closer look
> at the code. In Potsdam we decided to wrap persistent utilities with a
> complete acquisition context. But now I think this would be a mistake,
> so instead if implementing this I wrote a new proposal.
> 
> A complete acquisition chain usually contains the REQUEST object. This
> makes it impossible to cache wrapped utilities across request boundaries
> and supports the usage of self.REQUEST - something that should not be
> available in utilities.
> 
> I believe using self.REQUEST in tools was never a good idea, tools that
> can't be fixed should not be registered as utilities.

I guess you are right. Having all tools registered as utilities turned
out to be the false approach, but having those tools available as
utilities that are really utilities still seems to be a good idea. The
Acquisition wrapping makes sure those can actually be used in a Zope2
security context.

> five.localsitemanager should remove the REQUEST object from the
> acquisition chain before re-wrapping tools. AFAICS this makes the
> wrapped tools no longer request specific, making it possible to cache them.

[...]

> Does that make sense? If there are no objections I'll move on in that
> direction. This week I have some time to work on the implementation.

+1 from me.

As far as I can remember we had most of the code needed for that
approach already working, so this should get as a solution in a not too
distant future :)

Hanno



More information about the Zope-CMF mailing list