best grammar app

JSON – How it is changing the Information Landscape?

Submitted by Abhishek on Tue, 2012-06-19 17:57
json.org

Some years back when XML was becoming very popular method to store and exchange information in a text only format, little did people know that JSON is coming soon.  For people who are new to JSON,  JSON  stands for JavaScript Object Notation and is a lightweight data-interchange format, mostly like key value pairs. It is easy for humans to read and write as well as is easy for machines to parse and generate

 

Being a text only format, JSON is completely language independent. However JSON uses conventions that are familiar to programmers of the C-family of languages i.e. C, C++, Java, JavaScript, Perl, Python etc. These properties make JSON an ideal data-interchange language.

 

Before getting into details, Lets check out how a simple JSON content looks like

[

  {       

            Name: “John”,

            Age: 45,

            Country: “USA”

   },{    

            Name: “Michael”,

            Age: 24,

            Country: “UK”

   },{    

            Name: “Jim”,

            Age: 24,

            Country: “Australia”

   }

]

 

The example shows the Name, Age and Country date for John, Michael and Jim. If you see its fairly simple, there are keys and there are values. For showing collections we have an array with each value separated by comma.

 

JavaScript Object Notation (JSON) is built on two structures:

 

  • A collection of name/value pairs. This is like a Map or associative array where you have values denoted by keys (in our example “Name”, “Age” and “Country” are keys whereas “Jim”, 24, “Australia” are values.
  • An ordered list of values. This is like an Array or a List of values, comma separated. In our example we have data of thee people encapsulated in curly braces and separated by comma

 

Scenarios where JSON can be used

Due it its simplicity, JSON is being used in a number of places. Some scenarios are

 

Data Exchange

Data exchange happens to be one of the most important usage of JSON. Imagine you have two different systems (when I say different it could mean technically different, like a server which has been build on Java and a client which has been written in ASP.NET), Since there cannot be a language dependent thing that could act as their medium, choices are XML or simple Text. Simple text is not formatted and cannot be parsed easily. XML is too complicated and parsing is very expensive. JSON on the other hand falls in between and can be easily parsed.

 

Modern langagues like Java, JavaScript have methods with which you can easily convert a JSON String into an object. For example if we use the above JSON in javascript, we can do

 

var myObj=eval(jsonString);

 

Now if we do myObj[0].Name, we can get the value in key Name for the first item. I love how you can write strongly typed code with this ease of use.

 

Webservices happen to be the best medium when connecting different systems. When Webservices first became popular XML was thought to be the format of data exchange. However now JSON has replaced that.  REST Full web services use JSON heavily (giving rise to a very popular term JSON over REST).

 


Abhishek Mishra
Good experience in working with BPM technologies like Savvion, JBPM. Founder and Chief Editor of BPMGeek.com. Founder of Savvion Business Manager Mobility Framework Savmobify| View my BPMGeek Profile
|
best grammar app

About BPMGeek

BPMGeek is an initiative to collaborate and communicate with the growing Business process management community out there. The goal is to help developers connect with experts, ask questions, post their learning and get understanding of BPM Concepts. Often tool specific knowledge of niche areas end up developers perplexed and confused - especially when there are very less number of resources available. We will be coming up several several new features. Have a look at our Roadmap here

BPMGeek is an independent entity not associated with any Product. All BPM product professionals are invited to contribute. The Logos and Names used across the site belong to their respective owners. The viewpoints mentioned by Individual contributors are their own. BPMgeek cannot be held liable for any issues arising out of it.


BPMgeek is promoting the Nounshoun English Grammar App - developed by Constellation Software.