
faassen at vet
Oct 19, 2001, 3:54 PM
Post #6 of 10
(1815 views)
Permalink
|
delza [at] landry wrote: > > > Wow. Very ambitious. This would turn Zope into a very full-featured > > > XML respository. I wonder if it would be make sense to push some of the > > > DOM support down into ZODB? I can't claim to understand all the issues > > > there, though. > > > > How do you see pushing that into the ZODB? The ZODB just stores objects, > > right, DOM or not? > > Well, I'm thinking in terms of a generic XML repository, like Tamino or > XML-DB. If we're using XPath as a general query mechanism over a database, it > makes sense to put it *in* the database. On the other hand, this wouldn't > necessarily have to be baked into the ZODB, but could be an API which sits > between the ZODB and Zope. Maybe I'm confusing the goals with those of > other projects and this doesn't make sense at all. You could use the plain ZODB as a DOM repository, which is of course nice and would be of use in Zope. What would also be nice however is to enable the use of XPath (and perhaps later XSLT) in other contexts, such as existing Zope databases. For that you either need to equip current object with DOM powers (using mixin classes), or you create a new set of objects that knows how to give DOM interfaces to the existing data. > One of the things I like about ParsedXML, btw, is its balance of effeciency > with persistence: Store one object in the ZODB, but make it look like an > entire DOM tree to the user (at least, that's how I think it works!). Right; the entire tree is currently persistent only as a whole, not as the individual objects. This has advantages, mostly I think storage efficiency and probably also some use efficiency. The disadvantage is that it doesn't scale all the way up to huge documents and its' probably relatively inefficient for DOM manipulations, as changes to the DOM cause the entire tree to be stored again in a new transaction.. Eventually a hybrid segmented DOM approach may be the best solution. > Part of > the reason I start thinking about the ZODB when we talk about querying for > objects as if they were all XML is that it would be handy to do even outside > of Zope, in other projects which use the ZODB. I would like to be able to use > ParsedXML for general XML persistence from Python, but it seems to be closely > tied to Zope. So you're thinking about a generic way to represent arbitrary Python objects as XML. It's an interesting idea that I need to think about a bit more. I'm talking about a higher level representation of particular existing Zope objects. The advantage I see in the latter is that it may make more sense to a human than the direct representation of object internals. An advantage of a more generic representation would be that you represent absolutely everything, but of course that can also be a weakness -- it is what makes XML .zexps rather hard to read. > > > I'm afraid I don't understand the need for a registry. Shouldn't we be > > > patching low-level Zope objects with DOM methods so all objects inherit > > > the DOM API? I've just started reading the ZDOMIssues document, so > > > undoubtably I'm missing something. > > > > If you mean by 'low level Zope objects' things like Folder and DTML Method, > > I'm much in favor in making new objects that layer over these > > Zope objects. That'd be a much cleaner design. The *old* ZDOM works > > with mixin classes, but it never got very far and I think it's > > just too complicated. > > > > So I see somekind of registry that knows how to map any Zope object it > > encounters to a DOM object (usually an element with some attributes > > and probably some other nodes inside). This way you could even have > > different registries that do different mappings, some more detailed > > than the other. > > I can see how a registry could be useful, but I think it should be used to > *override* some reasonable default behavior. That is, any Zopish object > should be accessible via ZDOM, and objects which have special needs should be > able to register those to override the defaults. That would be an interesting compromise, though I'm still not convinced you could actually expose the implementation details... hm, what about security issues, for instance? Regards, Martijn
|