Monday, 4 August 2014

JSON Interview questions

 

 What is JSON?

If you are lazy to read the complete article see this video created by www.questpond.com  team which explains JSON in a short and sweet manner https://www.youtube.com/watch?v=vrPBtQAxw7c

JSON ( Javascript object notation ) is a simple data exchange format which helps to communicate between JavaScript and server side  technologies like Servlets , JSP , WCF , ASP.Net etc.

The format of JSON is as shown below. The below format represents a “Customer” object with “CustomerCode” and “CustomerName” property.

{"CustomerCode":"1001","CustomerName":"Shiv"}

                          

Now this format can be easily consumed by javascript and transformed in to javascript object. Look at the above figure where we have provided JSON to  javascript variable and you can see how a javascript object is evaluated with a “CustomerCode” and “CustomerName” property.

If you look at the web architecture it has two parts browser and server. On the browser side Javascript is the most prominent and well established language while on server side you have different technologies like JSP, ASP.NET, PHP etc.

                             

So if the server side technologies emit out JSON format which can be easily transformed in to a javascript object that would really ease the communication between multiple server side technologies and javascript language.

No comments:

Post a Comment