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

Lennart Regebro regebro at gmail.com
Mon Nov 13 10:21:40 EST 2006


On 11/9/06, Jean-Marc Orliaguet <jmo at ita.chalmers.se> wrote:
> Lennart Regebro wrote:
> > On 11/9/06, Chris Withers <chris at simplistix.co.uk> wrote:
> >> Why do you say "extra" ZCML registration? You need that ZCML
> >> registration whether or not you have to write the marker interface...
> >
> > Sure, but with the marker interface you need only one. You need one
> > for each class, in your example, thats two. So the second one is
> > "extra". :)
> >
>
> I think it is a mistake to use interfaces to specify what object _are_
> as opposed to what they can _do_. It is better to use base classes for
> that.

Yeah, but in this example there are no base classes available, as I
understand it.
So it's perfectly feasible to marl something with a marker interface
to say "this can be adapted to X". It is a "can do" marking, not an
"is" marking, IMO.

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


More information about the Zope3-dev mailing list