[Zope3-dev] PROPOSAL: Make ItoIRegistry part of Interface package

Jim Fulton jim@zope.com
Wed, 05 Jun 2002 08:46:02 -0400


I like the gist of this, though I don't have time to study it right now.

Jim

"Phillip J. Eby" wrote:
> 
> Rationale: ItoIRegistry has virtually no dependencies to the rest of Zope,
> but would be useful as part of a generally-distributed Interface
> package.  Other frameworks such as TransWarp and Twisted could make use of
> ItoIRegistry classes without being dependent on a "sumo" Zope
> distribution.  Also, ItoIRegistry could be used to implement a PEP 246-like
> Python adaptation system.  The resulting package would have a stronger case
> for becoming a Python standard library in the future.
> 
> Changes needed:
> 
> * ItoIRegistry currently strips proxies in the getForObject() and
> getAllForObject() methods.  Most of its callers (all the global services)
> *also* strip proxies, others (Event-related channels/services) do
> not.  This would need to change to either all callers stripping proxies, or
> else the proxy stripping registry would need to move to the Interface
> package, or be shipped with it.  (Ugh.)  I think that the semantics are
> actually cleaner if callers explicitly strip their own proxies, since there
> is currently no way to use an ItoIRegistry which looks up things for
> proxies themselves (as opposed to what they proxy)!
> 
> * ItoIRegistry uses the 'Invalid' exception from
> Zope.ComponentArchitecture.Exceptions to indicate a failed registration due
> to a component lacking a promised interface.  This would need to be
> replaced with a TypeError or something else available from the Interface
> package.
> 
> With these changes, ItoIRegistry could move to the Interface package,
> making it an even more valuable tool for third-party frameworks.  That
> should help to make the Interface package more popular, which benefits Zope
> and everyone else who uses Interfaces.  (Because the more standard it
> becomes, the more people want to use it, so the more standard it becomes,
> so it's accepted in more places, and so on, and so on...)
> 
> _______________________________________________
> Zope3-dev mailing list
> Zope3-dev@zope.org
> http://lists.zope.org/mailman/listinfo/zope3-dev

--
Jim Fulton           mailto:jim@zope.com       Python Powered!        
CTO                  (888) 344-4332            http://www.python.org  
Zope Corporation     http://www.zope.com       http://www.zope.org