[Zope-Coders] Re: [ANN] Proposed Features for Zope 2.7: OrderedObjectManager

Shane Hathaway shane@zope.com
Wed, 04 Dec 2002 15:29:01 -0500


Yuppie wrote:
> Shane Hathaway wrote:
> 
>> The larger burden is that Zope developers will come to rely on the new 
>> API, which will then be taken away for Zope 3.  It seems to me that a 
>> better course of action is to require Zope developers to specify that 
>> they need a folderish object that retains order and has the order 
>> maintenance API.  That way Zope developers insulate themselves from 
>> the effects of a pending change.
> 
> 
> Ok. One point for your score ;)
> 
> That argument makes me reconsider my position. You are right. We need a 
> migration plan. And I have no clear vision for the migration to Zope3.
> 
> I thought it could work like this: Zope2 Folders will become Zope3 
> OrderedFolders, Zope2 BTreeFolders will become Zope3 Folders.

One of the mandates of Zope 3 is that classes be as simple as they can 
be.  That means normal folders are currently little more than dictionaries.

> But for a smooth migration there should perhaps be a solution like this:
> 
> - Adding a new class OrderedFolder (or what ever the name should be) to 
> Zope 2.7 with an API that also will be implemented in Zope3.
> 
> - Adding a deprecation warning to methods of Zope 2.7 Folders that are 
> not continued in Zope3 Folders.
> With a message like this: "Method xxx is deprecated for Folders. Please 
> switch to OrderedFolder if you need this method in the long run."
> 
> 
> What do you think?

You would be adding methods that are deprecated before anyone gets to 
use them.  What's the sense in that? :-)

I am in favor of an OrderedFolder class that people have the option of 
using.  It's not necessary that it be in the core, since installing a 
Zope product is very easy.

I suggest that perhaps what you really want to do is refactor 
manage_main in such a way that parts of it can be overridden without 
overriding the whole thing.  Perhaps the best way to do that is to 
change it into a page template and fill it with "metal:define-macro" 
attributes.  It would be a little difficult, but might simplify 
OrderedFolder, ExternalEditor, FolderFilter, BTreeFolder2, and other 
products that want to tweak the folder contents listing.

Shane