[Interface-dev] [Fwd: Re: Interfaces status and coordination]

Jim Fulton jim at zope.com
Mon Jun 14 06:18:04 EDT 2004


Glyph Lefkowitz wrote:
> On Fri, 2004-06-11 at 08:19, Jim Fulton wrote:
> 
> 
>>But ... we have this new religion of adapters that tells me we should
>>be able to do this without resorting to subclassing. Of course, this
>>would require some long-overdue changes to the way the current interface
>>implementation works internaly.
> 
> 
> I wish I had a better way to describe this, but working with Imagination
> (the most exhaustive use of a components system that I've got experience
> with) I've come to believe that a component system actually enhances the
> value of subclassing in certain conditions.  Adapters are for combining
> and adding functionality.  Subclassing is for changing and overriding
> functionality.  This seems to fall squarely into the latter category...

I see adapters as a way to change functionality too. Or, more specifically,
I find adapters to be a way to distribute functionality among components
with low coupling.

> What are the changes you are referring to in the internals though?

See: http://dev.zope.org/Zope3/SpecificationUnification

In particular, I'd like to use adaptation to lookup code for
handling method definition in interfaces, adapting Python functions
to attribute specifications.

In the short term, I'd like to add an adapter registry used soley for
handling attribute definitions in interface definitions. This would
make method handling pluggable.  I think this would be much cleaner
than subclassing.  Wanna take a crack at this? If not, I'd be willing to
in the nect week or two.

Later today, I'll post a proposal for richer method definitions that
builds on this mechanism.

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 Interface-dev mailing list