[Zope3-dev] EventService, references, and subscription semantics
Jim Fulton
jim@zope.com
Tue, 26 Feb 2002 16:58:31 -0500
Shane Hathaway wrote:
>
> Steve Alexander wrote:
> > Shane Hathaway wrote:
> >
> >> class IReference (Interface):
> >> """Provides a way to find an object without necessarily keeping a
> >> strong reference."""
> >>
> >> def dereference(context):
> >> """Returns the referenced object."""
> >
> >
> > <deletia>
> >
> >> The nice thing is you can encapsulate both strong and weak references
> >> this way. The reference could hold an absolute path, a relative path,
> >> the object itself, a URL, a database query, etc.
> >
> >
> > The nice thing with Zope 3 is that we can define an IReferenceLookup
> > utility, so we can ask for an IReference adapter for a particular
> > object, and get an appropriate IReference.
>
> Well, I may be wrong, but I don't think you can go that far. If you
> have a persistent LDAP-backed user database and you want to register an
> LDAP-based user object as an event listener (perhaps to expire the
> user's password), how would the IReferenceLookup utility know to use a
> path/userid-based reference as opposed to a persistence-based reference
> or an LDAP-based reference? The only interface of the user objects is
> IPrincipal.
Why would a user object be limited to IPrincipal?
Jim
--
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