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

Yuppie yuppie@zedat.fu-berlin.de
Wed, 04 Dec 2002 10:26:04 +0100


Hi Shane!


Shane Hathaway wrote:
> Because in Zope 3 you'd be able to do it right.  In Zope 2 you can hope 
> for nothing better than a terrible hack.

It's a hack, but why is it terrible? The only existing method that needs 
to be changed is manage_renameObject. Everything else would work exactly 
like before if you don't want to use the new methods.
The code from Stephan is well tested und widely used in production.

> BTreeFolder2 already overrides manage_main, so AFAICT you wouldn't have 
> to change anything.

a) I use BTreeFolder2 as an example because it's the only unordered 
class I know that builds on top of Folder. Other products like this 
should also not break.

b) BTreeFolder2 overrides manage_main and some methods that make use of 
_objects. But you didn't know about the new methods it would inherit 
from Folder if we add the Order API. So either a new release of 
BTreeFolder2 or the OrderedObjectManager has to take care of the new 
methods.

> What's wrong with telling people who want ordered folders that they 
> should use the OrderedFolder product?  If it has bugs, let's just fix 
> the bugs. :-)

This is wrong with the OrderedFolder product:

1.) It's what we call in Germany an "eierlegende Wollmilchsau" (I don't 
know the right translation, word by word it would be "egg laying 
wool-milk-pig"). 90% of its users want ordered folders and not all the 
other whistles and bells.

2.) It's not just a new API, it's a new class. If you want to use it, 
you have to migrate all your content and all classes that build on top 
of the normal Folder.

3.) It's a product, not a part of Zope Core. People have to realize what 
they are missing, they have to find the product and they need to install it.


The OrderedObjectManager and OrderedFolderSupportPatch solve problem 1.) 
and 2.), but they add a new one:

4.) They monkey patch the ObjectManager. And they are not the only 
products doing this. manage_main is aka the monkey patch center.


The only way to resolve 3.) and 4.) is adding it to the core.

Cheers,

Yuppie