Wednesday, June 12, 2013

JSON

Characterstics of JSON
Easy to read and write JSON.
Lightweight text based interchange format
Language independent.

Uses of JSON
It is used when writing JavaScript based application which includes browser extension and websites.
JSON format is used for serializing & transmitting structured data over network connection.
This is primarily used to transmit data between server and web application.
Web Services and API.s use JSON format to provide public data.
It can be used with modern programming languages.

JSON supports following two data structures:
Collection of name/value pairs: This Data Structure is supported by different programming language.
Ordered list of values: It includes array, list, vector or sequence etc.
There are following datatypes supported by JSON format:
Type Description
Number double- precision floating-point format in JavaScript
String double-quoted Unicode with backslash escaping
Boolean true or false
Array an ordered sequence of values
Value it can be a string, a number, true or false, null etc
Object an unordered collection of key:value pairs
Whitespace can be used between any pair of tokens
null empty
Simple Example in JSON
Example shows Books information stored using JSON considering language of books and there editions:
{
    "book": [
    {
       "id":"02",
       "language": "CRM",
       "edition": "4.0",
       "author": "Sai Krishna"
    },
    {
       "id":"05",
       "language": "CRM",
       "edition": "2011"
       "author": "Sai"
    }]
}

No comments:

Post a Comment