Which do you use for storing user settings, global settings, values, etc and why one over the other?
Joined: Jul 11, 2001
A properties file is much easier to use when you have a small, fixed set of settings with a plain structure. An XML file implies more work, but is more appropriate to handle complex hierarchical settings.
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Joined: Jan 07, 1999
If you are comfortable with going for a simple solution first, and only adding extra complexity later if you really need it, then start with a Properties file (or, even bettter, a hard-coded Map). As long as you have some sort of "facade" through which you access these settings, then it shouldn't matter to the calling code which one you use. Then you are free to use hard-coded default values, load from a properties file, read some XML, run a database query, look them up in a JNDI repository, access a web service etc. etc.