On 11/13/06, Jean-Marc Orliaguet <[EMAIL PROTECTED]> wrote:
Indeed technically yes. Practically not. I couldn't find many examples
in the zope3 codebase that adapts classes.
The #1 pattern is to adapt from interfaces, it appears as though there
is a reason for it.

Yes, and I think both you and me mentioned it, but with different wordings.

If you specify it for a class, then only that class is adaptable. If
you want to use the adapter for yet another class, you have to
register it again. This is possible, but it's more flexible to specify
the adapter for an interface, and let all adaptable classes implement
that interface.

This is also a matter of specifying things for what they can do,
instead of for what they are, which you mentioned.

I'm not sure the proliferication (?) of marker interfaces is a big
risk. But if we get many of them, it still works better than the
options of magic __something__ attributes. :)

Lennart Regebro, Nuxeo     http://www.nuxeo.com/
CPS Content Management     http://www.nuxeo.org/
Zope3-dev mailing list
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com

Reply via email to