Win a copy of Java Database Connections & Transactions (e-book only) this week in the JDBC forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

Which is really the best?  RSS feed

 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The company that I work just for started full-blown e-commerce and web development using Java, XML, and WebSphere and is now going through the process of standardizing which type of parser we should use. It seems like the developers are split over DOM and SAX. I would like to know if anyone has a recommendation as to whether DOM or SAX would be a better fit for a high-volume, enterprise development shop?
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You MUST analyze your requirements in detail -
1. Bulk of data - if you have tens of megabytes, SAX is your only path. This is because a DOM must be all in memory - the various element objects plus all the text data at two bytes per character - it mounts up fast.
2. Type of data usage - if you want to correlate between entries, search, or otherwise manipulate the hierarchy, SAX is going to be VERY hard to apply.
3. Frequency/volume of use - if users are going to be hitting your catalog every few seconds, it makes sense to keep it all in memory in a DOM.
4. How dynamic is the data - if you have to be able to modify entries frequently, DOM is the way to go.
5. Do you really need to store XML? I know of one application where the SQL database output goes to make a temporary XML file just so a XSL transform can be applied to make final output.
Bill
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Then perhaps the solution shouldn't be one or the other, rather which should be used under various circumstances.
That really helps. Thanks!
 
All of the following truths are shameless lies. But what about this tiny ad:
how do I do my own kindle-like thing - without amazon
https://coderanch.com/t/711421/engineering/kindle-amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!