[Zope3-dev] RFC - Partial Adapters

Steve Alexander steve at z3u.com
Tue Dec 23 05:00:54 EST 2003


> Comments are, as always, welcome.

I expect this will work sensibly with interfaces that extend other 
interfaces.

So, let's say I have IContainer and IFishContainer. IFishContainer 
extends IContainer.

I register an ISublocations adapter C for IContainer, and I register a 
different ISublocations adapter F for IFishContainer.

Let's say I have a FishBowl object fb that provides IFishContainer. I 
expect that getPartialAdapter(fb, ISublocations, '') will return an 
iterable that looks like [instance_of_F] when listed.

Even if FishBowl provides IContainer explicitly, as well as by 
implication from IFishContainer, I would still get [instance_of_F].


Now, let's say I make my FishBowl object fb also provide ISiteManager. 
There is an adapter S from ISiteManager to ISublocations. Now, 
getPartialAdapter(fb, ISublocations, '') will return an iterable that 
looks like [instance_of_F, instance_of_S] when listed.


On a separate issue, would these "partial adapters" make the ordering of 
interface declarations unimportant?

--
Steve Alexander




More information about the Zope3-dev mailing list