S
stas
I have a general XML parsing related question.
Suppose I have a big java project with some kind of information stored
in a java file. Then I decide to move this information to an XML file
for easier editing and to eliminate recompiling the project every time
I add a new piece of data. The size of this XML file is rather small,
the syntax is quite simple: a few possible tag names, some capable of
containing an attribute. The java class that formerly contained and
processed the data that is now represented in XML format should now
parse this XML file.
Here comes the question! Should I separate the code that actually
retrieves the data from the XML file from the code that processes this
data (that is located in this former java class)? And if I should make
such kind of separation, what will the framework that retireves the
data from XML look like? Should it be java class for every XML tag
with methods for every subelement and attribute (seems like an
overkill to me), or should it be just some kind of "improved" parser
that is simply familiar with the syntax of my XML file? Is it eligible
to write such a framework that will need refactoring each time the
syntax of the XML file slightly changes?
Thanks.
Suppose I have a big java project with some kind of information stored
in a java file. Then I decide to move this information to an XML file
for easier editing and to eliminate recompiling the project every time
I add a new piece of data. The size of this XML file is rather small,
the syntax is quite simple: a few possible tag names, some capable of
containing an attribute. The java class that formerly contained and
processed the data that is now represented in XML format should now
parse this XML file.
Here comes the question! Should I separate the code that actually
retrieves the data from the XML file from the code that processes this
data (that is located in this former java class)? And if I should make
such kind of separation, what will the framework that retireves the
data from XML look like? Should it be java class for every XML tag
with methods for every subelement and attribute (seems like an
overkill to me), or should it be just some kind of "improved" parser
that is simply familiar with the syntax of my XML file? Is it eligible
to write such a framework that will need refactoring each time the
syntax of the XML file slightly changes?
Thanks.