[Zope3-dev] Re: Adaptergeddon status and milestone plans

Jim Fulton jim at zope.com
Fri Nov 21 12:25:30 EST 2003


Here's an update.

I just checked in:

 >   - Support for multi-adapters, which are adapters from multiple
 >     objects to an interface. A multi-adapter factory takes multiple
 >     objects and produces a single object implementing an interface.

These are used to implement views. There isn't yet support for this in
zcml or through the web. Adding ZCML support would be a good project
for someone.

 >   - Refactoring presentation components:
 >
 >     - Combine the Views, Resources, and Skins services into a single
 >       Presentation service.
 >
 >     - Reinterpret Views and Resources.  Resources are request
 >       adapters.  Views are multi-adapters, adapting objects and
 >       requests together.
 >
 >     - Views and resources are now adapters from a request
 >       type. Presentation types are no longer used for resource or view
 >       lookup.
 >
 >     - Allow views and resources to be registered to provide
 >       interfaces, with or without names.

Registering a view as providing an interface is not yet supported in ZCML.

 >   - Allow registration of adapters (and view, which are also adapters)
 >     for classes as well as interfaces.

Although I need to add some tests for registering for classes classes.
This *is* supported in ZCML.  You can specify a class for the "for" attribute when
registering adapters or views.

>   In addition, I've taken this opportunity to change some aspects of
>   the interface implementation and adapter strategies that I wasn't
>   happy with.  For performance reasons, I had introduces some rather
>   heavy-handed caches. I was worried about whether I would be able to
>   maintain these caches in the presense of local adapter and view
>   services and persistent interfaces.
> 
>   Most of the time spent so far has been on this interface and adapter
>   redesign. The strategy was inspired by an idea from PyProtocols,
>   which is to keep mappings (ie indexes) of specification (interfaces
>   or declarations) and adapter info that allow interface relationships
>   and adapters to be computed very quickly.
> 
>   I'm very happy with the refactoring so far. I think the architecture
>   is much cleaner that it was before and Zope runs much faster.
> 
>   Here's what's been done so far:
> 
>   - Global adapter and presentation services.
> 
>   - Working adapter machinery to support multi-adapters, class-
>     declaration-adapters, and local adapters.
> 
>   Here's what still needs to be done:
> 
>   - Local view and adapter services
> 
>   - Add support for mult-adapters and multi-views (views of multiple
>     objects) to the component architecture APIs.

Done


>     o adapters and views of classes

Done

I'd like to release a milestone release with these changes soon.  I'd like
people to try out the changes if possible before we make a release.

Note that, in the unlikely event that you were using local adapters, you
will need to recreate your adapter service and reactivate your adapter registrations.

If you had any local views, you will need to add a local presentation service
and reactivate your view registrations.

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