[jdom-interest] design question using jdom

Jim Knoll jknoll at jimknoll.dyndns.org
Tue Oct 2 18:10:11 PDT 2001


Hi,

I am totally new to xml and jdom and still trying to grasp object oriented
design.  The xml document I have created represents a data structure which
contains references to several other data structures.  I can successfully
parse the document using JDOM, but I am unsure of the best way to create
the data structures.  Should I pass each data structure the parent element
in the constructor and have it construct itself or should I create another
class that is responsible for constructing the data structure with all of
its references.

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.  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.

I can provide a sample document if that would help.

Thanks for any advice you can give me.

Jim




More information about the jdom-interest mailing list