The JSON format is specified in RFC 4627 by Douglas Crockford. The official Internet media type for JSON is application/json. The JSON file extension is .json.
The JSON format is often used for transmitting structured data over a network connection in a process called serialization. Its main application is in Ajax web application programming, where it serves as an alternative to the use of the XML format.
Electronic Data Interchange (EDI)
EDI can be formally defined as 'The transfer of structured data, by agreed message standards, from one computer system to another without human intervention'. Even in this era of technologies such as XML web services, the Internet and the World Wide Web, EDI is still the data format used by the vast majority of electronic commerce transactions in the world.
JSON – Data Interchange Format
It's simultaneously human- and machine-readable format;
* It has support for Unicode, allowing almost any information in any human language to be communicated;
* The self-documenting format that describes structure and field names as well as specific values;
* The strict syntax and parsing requirements that allow the necessary parsing algorithms to remain simple, efficient, and consistent;
* The ability to represent the most general computer science data structures: records, lists and trees.
JSON's basic types are:
* Number (integer, real, or floating point)
* String (double-quoted Unicode with backslash escaping)
* Boolean (true and false)
* Array (an ordered sequence of values, comma-separated and enclosed in square brackets)
* Object (collection of key: value pairs, comma-separated and enclosed in curly braces)
Advantages of JSON
* Simpler than XML because it is not a markup language and a natural representation of data.
* JSON is better data exchange format, XML is a better document exchange format.
* JSON is easier to read for machines with no/thin client-side library.
* JSON is a natural fit for data consumption by browser clients, for example Ajax components.
* Ability to represent general data structures: records, lists and trees.
* Parsing and generating JSON support in 21 languages.
Disadvantages of JSON
*JSON is a newer format so not enough tools to help with authoring & parsing. Some available are:
*JSON Tools – Java Tools for the JSON Format (parser, renderer, serializer, mapper, validator)
*JSON-lib – Java library for transforming beans, maps, collections, java arrays and XML to JSON and back again to beans.
*JSON in Java – Java APIs from json.org (see more below)
*JSON-taglib – JSON-taglib is a JSP 2.0 tag library used to render JSON data from within JSP code.
*JSON does not have a <[CDATA]> feature, so it is not well suited to act as a carrier of sounds or images or other large binary payloads.
* Unlike XML, JSON does not provide any display capabilities because it is not a document markup language. JSON was not even intended for that purpose.
* JSON is not extensible – it does not need to be because it's not a document markup language.
Comparison of JSON with XML
XML is simpler than SGML, but JSON is much simpler than XML. JSON has a much smaller grammar and maps more directly onto the data structures used in modern programming languages.
JSON is not extensible because it does not need to be. JSON is not a document markup language, so it is not necessary to define new tags or attributes to represent data in it.
JSON has the same interoperability potential as XML.
JSON is at least as open as XML, perhaps more so because it is not in the center of corporate/political standardization struggles.