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

Re: Serializing objects to and from XML documents.

Hi Falko,

Falko Braeutigam wrote:
> On Mon, 10 Jan 2000, Eric van der Vlist wrote:
> > Hi,
> >
> > I have (at last) found an opportunity to download ozone (0.3.3) and to
> > begin playing with it and I am amazed by the possibilities such a tool
> > is opening.
> >
> > One of them which I'd like to investigate further is to implement "XML
> > enabled" objects which could be initialized through XML documents and
> > would have also be able to be outputted as XML.
> To make this clear: we are talking about mapping of general (business)
> database objects into XML - not just storing/retrieving XML data, right? Ok,


> this one is on the to-do list already. We did not start working yet. Our first
> idea was to make a DOM that converts database content into XML using
> reflection and a given mapping (KOALA, BML or something). This would allow to
> access the entire database content via DOM and standard XML tools. The DOM
> methods that change nodes are a problem and not the only one I guess ;) So we
> need a good spec before we can start coding. Any ideas?

http://java.sun.com/xml/docs/binding/DataBinding.html ?

> >
> > It wouldn't be storing a DOM in ozone, but rather to convert DOM nodes
> > to object properties...
> Again, code that allows you to store/retrieve just simple XML data is already
> part of the current ozone package.
> >
> > I see many benefits of doing this.
> >
> > The input from XML would allow an easy initialization of complex
> > objects.
> > The output to XML would facilitate the usage by web application (using a
> > XSL transformation to produce HTML or XML).
> > The output + input would allow a kind of logical dump of objects.
> Yes, today oozone lacks an ad-hoc query interface/tool. XML/DOM seems to be
> perfect for this.
> >
> > With the few things I have seen of ozone, it looks like it would be
> > quite easy to implement a generic mechanism by extending the OzoneObject
> > class...
> Oh, not that easy, IMHO. ;)

It depends on the level of functionalities you want to accommodate... 

A simple mechanism where the programmer would define a specific
constructor which would manage all the attributes and handlers to manage
the sub elements would be quite straightforward to implement.

And a simple mechanism defining toXML methods ala toString wouldn't be a
big deal either.

It's what I had in mind when I wrote my first email.

I have discovered since that there may be more clever ways to do it :=)
> First we have to decide...
> 1. which mapping to use.
> 2. what is the database API for this new thing.
> Ideas, experiences?

I am investigating "Quick" http://www.jxml.com/quick to see if it can be
used with ozone.
> Falko
> --
> ______________________________________________________________________
> Falko Braeutigam                         mailto:falko@softwarebuero.de
> softwarebuero m&b (SMB)                    http://www.softwarebuero.de



Eric van der Vlist                                              Dyomedea

http://www.dyomedea.com                          http://www.ducotede.com