advice on storing in Zope instances of a python class inherited from UserList
Hi all, 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. The class models structured contents (text) organized as a hierarchical tree a few level deep and obtained by parsing an input data stream. The class instances are about 200.000 (i.e. BTree Folders will be needed), but their max. size is small (couple of KB). The key of using Zope (apart from being Python and object oriented) is to leverage the use of ZCatalog. 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. 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. Any advice or experience in implementing something like this (essentially a big single-object searchable storage) will be very helpful. Also, is there any problem on using Zope 2.6 instead of 2.5.1 (in principle better indexing, but all python work done so far is in 2.1.3 and I am worried about potential incompatibilities among BTree, XMLKit, ParsedXML, XMLTRansform and Zope 2.6). Thanks in advance, --Giuseppe Bonelli
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
participants (2)
-
Dieter Maurer -
Giuseppe Bonelli