[PEAK] PROPOSAL: Remove ZODB/Zope X3 dependencies/"compatibility"

Phillip J. Eby pje at telecommunity.com
Thu Jun 3 11:41:57 EDT 2004


At 12:40 PM 6/3/04 +0200, Ulrich Eck wrote:
>On Wed, 2004-06-02 at 23:20, Phillip J. Eby wrote:
> > No.  ITraversable is only responsible for traversing the name it has been
> > given.  IHTTPHandler is responsible for adjusting PATH_INFO and 
> SCRIPT_NAME
> > as traversal progresses.
> >
> > The reason for this division is that ITraversables can be used in non-HTTP
> > contexts, such as traversal to resources from skins, and data path
> > traversal in DOMlets.  These kinds of traversal should not have any effect
> > on HTTP variables in the environment, or else anything that needs to know
> > what URL was actually in effect would get confused.
>
>so .. would it make sense to factor out Traversal to some more general
>concept that has no knowledge about the way it is used at all except
>that there is some path to go (described by an url-part) through the
>component-tree.

It's not even going to "know" that.  It's going to be just a dictionary, 
that has no knowledge of its contents.  As a general rule, I don't like 
doing that sort of thing, but as long as the keys are encapsulated in 
functions, I think it'll be okay.


>this could then be used to implement imap/ftp like folderish
>representations of the component-tree or be used within config-options.
>it would allow to model the users-view independent from the actual
>domain-model .. sounds interesting for gui-apps as well.

Well, I don't know how you'd use it in such cases.  My mental model of a 
GUI is that you don't need to track anything "per hit", so you can just use 
components directly, and therefore use normal configuration.  The environ 
mapping in this is specifically to cache values that might change from one 
hit to the next.


> > In the current system, TraversalContext can compute both a "traversed URL"
> > and an "absoluteURL" by keeping track of the previous TraversalContext.  I
> > suppose I could do the same with 'environ', i.e. having each 'environ' 
> have
> > a pointer to the previous environ traversed from.  And the 
> IHTTPApplication
> > could set the initial environment's base "absolute" URL.
>
>i'm not yet clear about: is environ one instance that is usually passed
>through, or is the general case to copy the environ and hand it over to
>the next handler (like domletstate) ?

Copying.  In fact, I've already found that to properly replace Traversal 
and TraversalContext, it's necessary to at least copy it whenever you 
traverse to a new location, and give the new mapping a reference to the 
previous one.  This is needed for URL computations.

However, when not traversing, it is generally possible to simply share the 
existing mapping.




More information about the PEAK mailing list