[Zope3-dev] EventService, references, and subscription semantics
Steve Alexander
steve@cat-box.net
Tue, 26 Feb 2002 20:24:50 +0000
Sorry... typo/braino:
Steve Alexander wrote:
>
> Anyhow, if we still do want an anything-->IReference adapter, then we
> can easily build this on top of the IReferenceGenerator utility.
>
> The register() method of hub would look like this:
>
> def register(self, object):
>
> # get an IReference that is appropriate to object
> reference = getAdapter(object, IReferenceGenerator)
That should of course be:
reference = getAdapter(object, IReference)
>
> This would be implemented by an adapter-maker registered for
> anything-->IReference, like this:
>
> def ireference_maker(context_component):
> reference_generator = getUtility(context_component,
> IReferenceGenerator)
> reference = reference_generator(context_component)
> return reference
--
Steve Alexander