[jdom-interest] design question using jdom

philip.nelson at omniresources.com philip.nelson at omniresources.com
Tue Oct 2 20:15:57 PDT 2001


> I don't know if it is better to make each data structure 
> responsible for
> knowing its piece of the xml document, or if that data 
> structure should
> know nothing of xml and rely on another class to create it.  

Hey, at least your asking the right questions ;-)

> That would
> mean the class creating each of the other data structures has to know
> about the xml document and each of the individual classes it 
> is to create.

Having done both, I would say that keeping your class simple and not having
it supported directly by an xml document is going to work best in most
cases.  Then have a marshal and unmarshal method to write and read the xml
as needed.  There are good reasons to do it the other way but if you are
just getting started, this will probably work well for you.  As Bob pointed
out, you could take the marshalling step further and have done by settings
kept in a properties files (or xml document).

You may want to look at zeus.enhydra.org for a tool that can do some of this
for you.



More information about the jdom-interest mailing list