[Zope3-dev] Using parent references rather than context wrappers to represent containment

Jim Fulton jim at zope.com
Tue Aug 12 06:33:35 EDT 2003


Phillip J. Eby wrote:
> At 08:30 AM 8/11/03 -0400, Jim Fulton wrote:
> 
>> I find this unacceptable for component lookup,
>> as context awareness should not be a prerequisite for using
>> the component architecture.
> 
> 
> I thought this too, in PEAK, and originally had a global context, plus 
> an optional "local" context that was intended for per-thread context.  
> Then I found that the cost of having to explain to people why things 
> didn't work as they expected, was a higher overhead than what I was 
> "saving" them by trying to DWIM a context.

I don't know if what you are refering to has anything to do with
what's being discussed here.

I don't think that anything I've suggeted involves DWIM.

In a seaparate discussion, I've proposed that the single context
used for a request be determined by the location of the request,
rather than by the location of the objects involved, unless
overridden.  This is no more DWIM than using a single global context.
A single default context is used in either case.

IMO, the *current* case, there the place to look up components is
determined by the context, if any, of the first object passed is much
more DWIMish.  Subtle mistakes in managing context can cause component
lookup to fail.  I'm not making this up. I've helped people debug this
sort of problem, which is reminiscent of Zope 3 acquisition problems,
because, of course, it is am acquisition problem.
This is exactly the sort of thing I'm trying to avoid.


Jim

-- 
Jim Fulton           mailto:jim at zope.com       Python Powered!
CTO                  (703) 361-1714            http://www.python.org
Zope Corporation     http://www.zope.com       http://www.zope.org




More information about the Zope3-dev mailing list