configuration of applications -- XML or Properties files?

Hi all

I am building a customer website on Jakarta tomcat 5.5.9 and struts. This is going to be a customer login site where the customers will be able to login in, see their bills online (run reports and pdf) and do some other functionalities like user management etc.

I am trying to make the website an extensible and robust application. I have incorporated -- 1) a robust exception handling framework with struts declarative exception handling 2) a neat abstract factory pattern etc.

I am putting as many configuration information in a file as possible. The various configuration properties that i have abstracted out -- to be put in a configuration file are as follows --

a) DAO queries

b) parameter which tells the application whether the database is oracle, mysql, sybase etc etc so that those dao queries are picked from the file (by the way, i want to make my application database independent).

c)other application parameters like --

1) email settings (system admin emails).

2) Jasper report settings.

3) logging file settings.

my problem is there is a confusion whether to make this configuration file anXML file or a properties file?

Proponents ofXML file say it is application independent, universally accepted, is so flexible, can hold hierarchical data, easy to maintain etc etc.

Proponents ofproperties file (as a configuration medium) say -- it is a flat file with simple name-value pairs so it a very fast medium and since a parsed XML tree takes much RAM memory and since XML is so slow (and takes system resources), it is wise to use properties file as a configuration medium.

Can any expert please advice me which way to go now? should i go for a flat but somewhat clumsy method of properties file or a hierarchical, easily maintainable but slow and heavy XML file?

please advice me on this thread as soon as possible. any suggestions will be highly appreciated.

regards,

Vaibhav Beohar

[2033 byte] By [vaibhavkba] at [2007-10-1 23:00:30]
# 1

Hi Vaibhav,

The answer is based on the System you develop and how often the properties will change and does the application need to reload the properties when there is a change?

I use Property / XML file only when the property does not change a lot and teh expectation set is that any such changes will require a restart of the Server and application non-availability.

I have also used Database tables to persist all these Property values and cache them at application level using a startup class when the application server starts up. There was an Administrative screen in our application which can refresh the data from Database if there was any change in the Property value. This way I did not have a downtime of the application and I was able to achieve refreshes.

Choose the right choice to implement based on what your application wants to achieve.

Hope this help you!

Thanks and regards,

Pazhanikanthan. P

pazhanikanthana at 2007-7-15 13:58:03 > top of Java-index,Enterprise & Remote Computing,AVK Portability...