[Zope3-dev] EventService, references, and subscription semantics

Phillip J. Eby pje@telecommunity.com
Tue, 26 Feb 2002 11:09:02 -0500


At 03:49 PM 2/26/02 +0000, Steve Alexander wrote:
>Phillip J. Eby wrote:
>>
>>>
>>>I don't think this covers having a manager in an object's context 
>>>provide its reference.
>>
>>Such a facility can be encapsulated in an adapter that provides 
>>'IReferenceable'; it doesn't need to be (and IMHO shouldn't be) in the 
>>core usage pattern.  An object which wants an 'IReference' should be 
>>insulated as much as possible from the mechanics of *how* to get it.
>>The how is a policy, and therefore should be *behind* an interface, not 
>>in front of it, if you see what I mean.
>
>I quite agree. What I meant was that your proposal did not seem to have 
>the scope to address in particular Shane's example of an IPrincipal object 
>that is provided from an LDAPUserSource.

Hm, correct me if I'm wrong, but isn't there a standard way to look up a 
Principal using an ID?  If so, then a generic IPrincipal -> IReferenceable 
adapter should be possible, and reusable for all user sources.


>Expanding the scope a bit, I think that one particular implementation of 
>IReferenceable would need an IReferenceGeneratorForContext (rename as you 
>like) that it would get as a utility from the object's context.

Yes.  And that implementation could be the default adapter for objects 
without a more specific adapter type registered.