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
_______________________________________________
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com

Reply via email to