aspose file tools*
The moose likes Performance and the fly likes Better Access performance : XML vs Properties Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Performance
Bookmark "Better Access performance : XML vs Properties" Watch "Better Access performance : XML vs Properties" New topic
Author

Better Access performance : XML vs Properties

shukla raghav
Ranch Hand

Joined: Aug 03, 2008
Posts: 200
I am just been introduced with a new application where I see that SQL Queries are stored in XML files rather than being stored as a property in the property file. Is there any benefit from retrieving from XML rather than from Property.

Please let me know other criteria on which property can be compared to XML

Thanks in advance
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39548
    
  27
XML has capabilities/flexibilities that properties files have not. Whether those make a difference in your case, we can't possibly know. Assuming that those files are read only once at application startup, I can't imagine that using one or the other has a noticeable performance impact.


Ping & DNS - updated with new look and Ping home screen widget
shukla raghav
Ranch Hand

Joined: Aug 03, 2008
Posts: 200
Yes these files are loaded once into the cache at the time of startup. But as you have said that there is no noticeable performance difference when using XML or property, then what benefit do we get from using XML for storing information when properties are easier to maintain and more intuitive and comprehensive.

And for that matter why not even the server configurations details also not in properties like instead of struts.xml why not struts.properties for same purpose or instead of web.xml we have web.properties and likewise. Eventually both are accessed at runtime.

William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12678
    
    5
what benefit do we get from using XML for storing information when properties are easier to maintain and more intuitive and comprehensive.


You would not be wondering if you had tried to work with early servlet containers before web.xml was standardized. There was a profusion of properties files with complicated names and the names of properties used a sort of dot notation to associate values with various parts of the system.

XML rescued us from that mess because it can:
1. represent complex data hierarchies close to the way programmers think about them
2. be modified by adding new elements without screwing up the interpretation of the older ones.
3. be subject to formal proof of correct structure, etc

Bill

Java Resources at www.wbrogden.com
shukla raghav
Ranch Hand

Joined: Aug 03, 2008
Posts: 200
So i get it. Use XML


1. When you want validation of content.
2. And hierarchical representation of our data.

as far as performance access of data is concerned, Not much of a difference.

Thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Better Access performance : XML vs Properties
 
Similar Threads
Using CMP entity bean with stored procedure?
hibernate_struts_tomcat
Encoding XML file using Base64Encoder
Customizing Ant /JUnit XML Output
jndi vs hashmap in context