aspose file tools*
The moose likes XML and Related Technologies and the fly likes Am I doing this a good way or bad way? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Am I doing this a good way or bad way?" Watch "Am I doing this a good way or bad way?" New topic
Author

Am I doing this a good way or bad way?

Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15290
    
    6

Ok, I am writing an application and I decided to use an XML file(s) to store configuration information. I am going to post my code and I would like someone to tell me if this is the correct approach or if I am way off base here because I have never done this stuff before.
First, this is my XML config file.

Now, here is the file where I do the work wiht the config file. I get an instance of this file in every class I need, and then I am building methods as I go for the configuration information that I need to get and I have getXXXX() methods to retrieve this info.

Everything works, so I am not having any problems there. I am more interested in my approach. Thanks for any suggestions.


GenRocket - Experts at Building Test Data
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
I don't see anything wrong in your approach. I might be blind, of course, so another opinion and a pair of eyes would be more than recommended...


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Am I doing this a good way or bad way?
 
Similar Threads
Couldn't access xhtml table using JDOM XPath
JDOM works normally not with JSP
root.getRootElement() is throwing an NullPointerException
Read XML into Java Array
Urgent help !!!!!!