[ZODB-Dev] Re: _v_skininfo

Casey Duncan casey at zope.com
Tue Apr 20 09:29:43 EDT 2004


On Tue, 20 Apr 2004 13:57:11 +0100
Chris Withers <chris at simplistix.co.uk> wrote:

> Casey Duncan wrote:
> >>>  4. attributes that live precisely for the current request
> >>>
> >>>     used for things like "_v_skininfo".
> >>
> >>Surely these should be put IN the request obejct then?!
> > 
> > Probably, just may sure the case where multiple CMF sites are
> > involved in a single request is properly handled.
> 
> Well indeed. Maybe _v_skininfo should be a dictionary then?
> In any case, this smells application-level to me.
> 
> I don't see any motivation for adding weird new _v_'esque things that
> last for exactly the length of the request, when we already have just
> such a container for these: the request itself...

Agreed. Smells like YAGNI. 

_v_skininfo is just a cache. It's ironic though in light of this thread
because it contains a reference to the request to make sure it isn't
used across requests. One possible case that might need consideration
though is when you don't have a request. It looks like setupCurrentSkin
punts in this case currently so that should be fine.

A word of caution: Skinnable.py is pretty delicate code, I'm not sure
how well unit-tested it is, but any changes to it need to be well
thought out.

That said I think we should consider moving the skin cache to the
request, by appearances it should simplify the code.

-Casey



More information about the ZODB-Dev mailing list