[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: DB implementation - Relationships between Collection, Resource and XMLContainer



Thanks for you quick reply Lars,

> > I'm not sure if choosing Node for Resource content is right. it
> works but
> > maybe I'm not considering all scenarios. When Lars put the
> skeleton code in
> > CVS he seemed to have had the idea to use an XMLContainer for
> the content
> > instead of Node.
>
> Are you using a persistent DOM Node or how do you ensure to make a
> node persistent in ozone?

Yes, the Node is a private member of
org.ozoneDB.xml.cli.resources.XMLResourceImpl which in turn is stored in a
Map of Resources in org.ozoneDB.xml.cli.CollectionImpl.

> The reason why I used XMLContainer instead
> of Node as a member of XMLResource is that XMLContainer already
> implements helper methods to store/retrieve content (SAX, DOM, ...)
> in a very efficient way (streaming). Without this you have to re-
> implement such features because you'll come to the point where you'll
> need them.

I see, good point. DOM and String seems to be very straighforward with this
solution (couple of lines of code per method) but maybe for SAX it is more
complex and it would be better to use the existing XMLContainer instead.

> My aim was/is to preserve the current OzoneXML-API (except of the
> addition of collections). Therefore I would like to see the XML:DB API
> on top of ozoneXML, because the ozoneXML API is much "rawer" then
> XML:DB.

Right, that seems like a good design goal - to layer the XML:DB api on top
and use whatever exists in the core already. The code seemed more clean with
the approach i took but i'll look into it again.

> On the other hand I don't want to mix the implementation of XML:DB
> with the core ozone features like proxies, database objects, ...
> If you will take a look at the "xml/core" module you'll find the
> counterpart of XMLContainer what is the persistent XMLCollection.

I'm not sure I follow what you are suggesting: is there already a
XMLCollection in the core that works as a holder and manager for
XMLContainer (i.e XML resources)?

Best regards,
Per