From Robs_Wiki
Revision as of 14:56, 10 February 2020 by Qadmin wiki (talk | contribs) (Features of JSON)
Jump to: navigation, search


For a while, XML (extensible markup language) was the only choice for open data interchange. But over the years there has been a lot of transformation in the world of open data sharing. The more lightweight JSON (Javascript object notation) has become a popular alternative to XML for various reasons. A couple obvious ones are:

  • Less verbose- XML uses more words than necessary
  • JSON is faster- Parsing XML software is slow and cumbersome. Many of these DOM manipulation libraries can lead to your applications using large amounts of memory due to the verbosity and cost of parsing large XML files.

JSON snippet

         "author":"Dennis Ritchie "
         "author":" Bjarne Stroustrup "

Why use JSON ?

•Provide support for all browsers 
•Easy to read and write
•Straightforward syntax
•You can natively parse in JavaScript using eval() function 
•Easy to create and manipulate 
•Supported by all major JavaScript frameworks 
•Supported by most backend technologies
•JSON is recognized natively by JavaScript
•It allows you to transmit and serialize structured data using a network connection. 
•You can use it with modern programming languages.
•JSON is text which can be converted to any object of JavaScript into JSON and send this JSON to the server.

Features of JSON

  • Easy to use - JSON API offers high-level facade, which helps you to simplify commonly used use-cases.‬ ‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬
  • Performance - JSON is quite fast as it consumes very less memory space, which is especially suitable for large object graphs or systems.
  • Free tool - JSON library is open source and free to use.
  • Doesn't require to create mapping - Jackson API provides default mapping for many objects to be serialized.
  • Clean JSON - Creates clean, and compatible JSON result that is easy to read.
  • Dependency - JSON library does not require any other library for processing.

Rules for JSON syntax

  • Data should be in name/value pairs
  • Data should be separated by commas
  • Curly braces should hold objects
  • Square brackets hold arrays