[Zope3-dev] RFC - Partial Adapters
Jim Fulton
jim at zope.com
Mon Dec 22 17:17:38 EST 2003
I've written a proposal for partial adapters:
http://dev.zope.org/Zope3/PartialAdapters
Partial adapters support using multiple adapters to perform
a function, providing separate adaptation for independent
interfaces.
"Consider the following example. We need to find the objects for
an object such that the __parent__ of the foujnd objects is the
starting objects. We'll call this interface !ISublocations.
We can easily define the sublocations for !IContainer as the
containers values. We can also easily define the sublocations for
a site. A site has the site manager as it's sublocation. Now, it
turns out that the only object that can currently be a site is a
folder, which implements !IContainer. We could define a
!ISublocations adapter for !IFolder that combines the container
values and the site manager, however, in theory, any object could
be a site, It would be cleaner to define !ISublocations adapters
for !IContainer and !ISite and to be able to use both adapters
when looking for sublocations of a folder that is also a site."
Comments are, as always, welcome.
Jim
--
Jim Fulton mailto:jim at zope.com Python Powered!
CTO (540) 361-1714 http://www.python.org
Zope Corporation http://www.zope.com http://www.zope.org
More information about the Zope3-dev
mailing list