This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I have a Web Application calling 3rd party Web Services. This application needs a number of configurable parameters.
For eg: Java.util.logging parameters, Web Services URLs and other parameters. Which is the best place to store them as configurable parameters?
1. I can store them in my Web.xml and retrieve them in the Servlet, but I might have to redeploy my application everytime, one of the parameters changes.
2. I can store them in a properties file, say, ABC.properties, using a static class or a Singleton to a access the properties. But is it OK to read configurable properties in this way from a J2EE application?
It all depends on the requirements for your application. If you truly need your application to be running all the time and can't spare a few minutes for a redeploy, then most of those solutions wouldn't be viable. Possibly a database if you're looking for 24x7 availability. How often are these values changing? What are your availability requirements? Etc ...