[Zope3-dev] wildcard adapter

Marius Gedminas mgedmin at b4net.lt
Thu Jan 18 07:59:00 EST 2007


On Thu, Jan 18, 2007 at 08:55:17AM +0000, Chris Withers wrote:
> Marius Gedminas wrote:
> >BTW passing interfaces to provideAdapter/<adapts> is out of fashion. 
> 
> This stuff is getting almost perl-ish in it's "there's many ways to do 
> it, pick the style you like" nature..

There's a slight difference, I think.  In the Zope 3 world, there's
usually one style that is considered to be the best way of doing stuff.
Only it varies with time and with individual Zope 3 developers. ;-)

> >I
> >prefer using zope.component.adapts and zope.interface.implements (or
> >zope.component.adapter and zope.interface.implementer, when my adapter
> >is a function rather than a class).
> 
> I often register the same adapter factory for several different types or 
> objects / interfaces. How would I do that with your favoured spelling?

If you pass the adapts/provides arguments to provideAdapter (or the ZCML
directive), the values you specify override the defaults declared by the
adapter itself.

Marius Gedminas
-- 
Some people have told me they don't think a fat penguin really embodies the
grace of Linux, which just tells me they have never seen a angry penguin
charging at them in excess of 100mph. They'd be a lot more careful about what
they say if they had.
                -- Linus Torvalds, announcing Linux v2.0
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mail.zope.org/pipermail/zope3-dev/attachments/20070118/70ae150a/attachment.bin


More information about the Zope3-dev mailing list