[Zope3-dev] Re: adapter registration question
Philipp von Weitershausen
philipp at weitershausen.de
Wed Nov 15 15:37:07 EST 2006
Jean-Marc Orliaguet wrote:
> str(123) has the same syntax as IZopeDublinCore(myobj), but semantically
> there is nothing in common between the two expressions.
I disagree.
>>> IZopeDublinCore(obj)
is a flexible version of
>>> ZDCAnnotatableAdapter(obj)
Flexible, because a different implementation that ZDCAnnotatableAdapter
might be used. That's dispatched through the adapter registry.
> IZopeDublinCore(myobj) does an adapter lookup based on the type of
> 'myobj'
That's the lookup in the registry (part 1 of the adapter call)
> and returns an adapter instance with myobj as context, ready to
> be used.
That's the instantiation a la str(123) (part 2 of the adapter call)
> but what problem is all this supposed to solve? are you guys writing a
> PhD or something .-) ?
Heh, now that you mention it... ;)
--
http://worldcookery.com -- Professional Zope documentation and training
More information about the Zope3-dev
mailing list