[Zope3-dev] Re: Providing flexible adapters
Shane Hathaway
shane@zope.com
Tue, 26 Feb 2002 11:15:16 -0500
Phillip J. Eby wrote:
> At 10:40 AM 2/26/02 -0500, Shane Hathaway wrote:
>
>> Zope 3's answer is to make a reference generation utility. It would
>> be a very, very simple utility that might just look up an adapter. If
>> we later decide that the adapter registry is sufficient, we can just
>> leave it that way. If we instead decide that generating a reference
>> depends on not just the interfaces of the object, but also the
>> interfaces of the object's context (or something else), we can make a
>> new service.
>
> Interesting. Are utilities placeful?
Yes. So are adapters, utilities, and services.
> I'm not sure that putting the utility in front of the adapter gives any
> advantage for this situation, however. One could always register an
> adapter that looked up the utility, right? So if we expect the normal
> case to be just an adapter, it seems more straightforward to use the
> adapter, reducing the number of layers of delegation for the common case.
I agree, but I'm not sure that the normal case is an adapter. And if it
is, but we don't provide a way to change how references are created, how
will people implement the special cases?
> Then maybe there should be an IReferenceable adapter that adapts
> anything, by looking up a placeful utility. :) Then we get two for the
> price of one, so to speak. Ain't ZCA grand? :)
I'm trying to reuse concepts from the Python language. Every object in
Python is implicitly "referenceable". I do not believe there is a need
to further abstract the concept.
Shane