This is a mirror of official site: http://jasper-net.blogspot.com/

Understanding basic JSON

| Wednesday, June 2, 2010
JSON (JavaScript Object Notation) is a data representation format that can be considered an XML competitor. It’s structure is totally different from the XML one (since the structural principles differ), but the general idea is the same – it should ensure easy data transportation between applications and services. It is already implemented in several existing web services (small and large, like Twitter) and its share on the data exchange format market is growing due to its simplicity and organization.

If you want to take a look at some differences between the two formats, you can take a look at this article. Here, I am going to focus solely on the basics JSON.

Here is an example. Let’s suppose I have a data set, describing various computer parts, and I need to provide this data to an application. If I am going to think very abstract, there is a tree like structure, representing the base element (Computer Parts) and multiple child branches (for example: mainboard, keyboard, CPU, fan etc.)

By using the JSON data format, I can show the same tree-like structure just like this:

{ “parts” : {

“part” : [
{ “name” : “Mainboard” },
{ “name” : “Keyboard”  },
{ “name” : “CPU” },
{ “name” : “FAN” }
] }
}

Read more: DZone

Posted via email from jasper22's posterous

0 comments: