[Zope3-dev] adaptation based on class rather than interface

Lennart Regebro regebro at gmail.com
Thu Nov 9 06:30:23 EST 2006


On 11/9/06, Chris Withers <chris at simplistix.co.uk> wrote:
> It's not one to one:
>
> <adapter
>      for=".myclasses.MyClassA"
>      provides=".interfaces.ISomething"
>      factory=".adapters.MyAdapter1"
>      />
>
> <adapter
>      for=".myclasses.MyClassB"
>      provides=".interfaces.ISomething"
>      factory=".adapters.MyAdapter1"
>      />
>
> <adapter
>      for=".myclasses.MyClassC"
>      provides=".interfaces.ISomething"
>      factory=".adapters.MyAdapter2"
>      />
>
> <adapter
>      for=".myclasses.MyClassD"
>      provides=".interfaces.ISomething"
>      factory=".adapters.MyAdapter2"
>      />
>
> Re-use of adapters without having to create or use a mixin...

So instead of making a marker interface, which is two lines of code, a

I'm not against your suggestion, but I'm not convinced it's actually useful.

-- 
Lennart Regebro, Nuxeo     http://www.nuxeo.com/
CPS Content Management     http://www.nuxeo.org/


More information about the Zope3-dev mailing list