• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

fail to understand XML mystry

 
Ranch Hand
Posts: 199
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

As per my bst knowlwdge, html deals with presentation layout where as xml take care of the data to be displayed.
But i just fail to understand is why do we need xml to maintain data? We can use one of various patterns available (Data Transfer Object, Value Object)to store data, just as we do in MVC.
Why do we actually need xml?
Where else should we use xml?
***********************************
Moreover when we talk about xml being plateform independent, is HTMl+jsp not a plateform independent combination

Kindly Clarify
Thanks a lot in advance
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I feel qualified to answer this since I use XML extensively to maintain sets of questions for mock exams.
1. XML is easy to edit (how do you edit a JDO?)
2. XML is easy to transform
3. With XML you can add new fields and functions without breaking old programs
4. XML provides verification facilities (DTD, Schema, etc)
5. XML documents are easy to explain to other people, especially when your data has a deep hierarchy. (compare a relational DB)
6. In MVC - XML documents make a great way to store the M and I frequently have a model class that holds a DOM in memory.

Bill
 
Ranch Hand
Posts: 311
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My company uses XML for portability.
As log as you stick to communication between Java applications, it may be ok to consider Java "value objects", passed using RMI or java Object Streams.
However, our current situation also requires communication between C++ dot Net applications, Java applications, MainFrame/Natural systems, and more. So you need a data format that everyone agrees upon, and everyone has a reasonable API for writing/reading. I wish I could make them all implement (or download) some API for manipulating the Java serialization format, but XML was a more popular choice.
On the plus side, it's easy, acceptable for most programmers (Natural people had to write some adapters), and very easy to debug & log.
On the minus side, it's not a very compact format. And I'm still looking for a good serialization tool (that would, for example, maintain references & relationships). I believe there are some reasonably good tools. Still waiting for a reply on a question I've posted on the subject.
 
And when my army is complete, I will rule the world! But, for now, I'm going to be happy with this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic