I am trying to make a decision for data transfer appraoch in a java application.
I am not sure if I should use JSON or XML.
Any comments will be useful.
Thanks in advance.
Anu Bhagat
SCJP5.0, SCJA
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35249
7
posted
0
"In" a Java application? What are the two ends of the transfer?
xml has a definition file which can be used to validate that your tags are correct.
Both the formats are well supported for parsing so I guess you can go with which ever, although in the industry, xml is often favored.
Marcos Vidolin
Greenhorn
Joined: May 10, 2011
Posts: 25
posted
0
The approach will depend on what you want. In general I have used JSON because it's smaller and more readable than XML.
Just for note, Twitter and Foursquare left XML and started using exclusively JSON.
The following code snippets represents the same data:
JSON
XML
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.