[Zope] advice on storing in Zope instances of a python class inherited from UserList

Dieter Maurer dieter@handshake.de
Fri, 24 Jan 2003 23:14:44 +0100


Giuseppe Bonelli wrote at 2003-1-24 11:20 +0100:
 > I want to use Zope as the persistent storage for a big number of instances of a python class inherited from UserList and I ask advice to this list's wisdom on the best strategy to use.
 > ....
 > I see 2 alternatives:
 > 1. Store them as XMLDocument instances (from XMLKit) and use ParsedXML and XMLTransform to build a search and display UI using XSLTs.
 > 2. Store them using their native python structure and build from scratch a dtml search and display UI.
I would go for 2.

XML processing in (pure) Python is very slow.

When you go for XML, you should consider "libxml/libxslt" or
(maybe) "4xslt" (the FourThought XSLT processor; when I last
used it about 18 month before, it was still incredibly slow;
but great progress had been reported ...)

 > Main advantage of 2. should be performance (no extra xml layer), but standard Zope objects don't seems (at least as far I Know) to permit an easy implementation of hierarchies of UserList-like properties and I would like to maintain a 1 object for each class instance approach. On the other hand, the xml approach seems natural because of the hierarchical nature of the class, but I am worried about performance issues due to the extra xml layer.
Why do you think that?

I do not see any problem for nested "UserList" attributes.

However, they cannot be mapped to properties.
This means, you must do the UI yourself.


Dieter