Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Better Access performance : XML vs Properties

 
shukla raghav
Ranch Hand
Posts: 203
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42968
73
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
shukla raghav
Ranch Hand
Posts: 203
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13074
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
shukla raghav
Ranch Hand
Posts: 203
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic