[Zope3-dev] reasonable syntax for multi-adaptation

Brandon Craig Rhodes brandon at rhodesmill.org
Wed Sep 26 10:04:47 EDT 2007


The current syntax for multi-adaptation makes the interface look like
an object of the adaptation, rather than the actor in the operation.
Instead, multi-adaption should look like this:

  IFoo(multi=(obj1, obj2))

or:

  IFoo(multi=(obj1, obj2), name='site_foo')

The first draft of such an implementation could simply intercept a
"multi" keyword passed to InterfaceBasePy.__call__(), and hand control
over to the traditional getMultiAdapter.  The old getMultiAdapter call
should always remain available, but code will become much easier to
read as the new syntax is adopted and single- and multi-adaptation
become visually congruent.

I'll be happy to develop a patch and test cases.

-- 
Brandon Craig Rhodes   brandon at rhodesmill.org   http://rhodesmill.org/brandon


More information about the Zope3-dev mailing list