json the fatfree alternative to xml4594

Upload: rahul-kale

Post on 02-Jun-2018

227 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/10/2019 Json the Fatfree Alternative to Xml4594

    1/21

    Presented by

    Pushkar S. Dahibhate

  • 8/10/2019 Json the Fatfree Alternative to Xml4594

    2/21

  • 8/10/2019 Json the Fatfree Alternative to Xml4594

    3/21

    JSON is a simple, common representation ofdata.

    Communication between servers and browser

    clients.

    Language independent data interchange.

  • 8/10/2019 Json the Fatfree Alternative to Xml4594

    4/21

    Database Model

    Document Model

    Programming Language Model

  • 8/10/2019 Json the Fatfree Alternative to Xml4594

    5/21

    JavaScript Object Notation

    Minimal

    Textual

    Subset of JavaScript

  • 8/10/2019 Json the Fatfree Alternative to Xml4594

    6/21

    A Subset of ECMA-262 Third Edition.

    Language Independent.

    Text-based.

    Light-weight.

    Easy to parse.

  • 8/10/2019 Json the Fatfree Alternative to Xml4594

    7/21

    JSON is not a document format.

    JSON is not a markup language.

    No cyclical/recurring structures.

    No invisible structures.

    No functions.

  • 8/10/2019 Json the Fatfree Alternative to Xml4594

    8/21

    Filename extension:- .json

    Internet media type:- application/json

    Uniform Type Identifier UTI):-

    public.json Type of format :- Data interchange

    Extended from :-JavaScript

    http://en.wikipedia.org/wiki/Filename_extensionhttp://en.wikipedia.org/wiki/Internet_media_typehttp://en.wikipedia.org/wiki/Uniform_Type_Identifierhttp://en.wikipedia.org/wiki/JavaScripthttp://en.wikipedia.org/wiki/JavaScripthttp://en.wikipedia.org/wiki/Uniform_Type_Identifierhttp://en.wikipedia.org/wiki/Uniform_Type_Identifierhttp://en.wikipedia.org/wiki/Uniform_Type_Identifierhttp://en.wikipedia.org/wiki/Internet_media_typehttp://en.wikipedia.org/wiki/Internet_media_typehttp://en.wikipedia.org/wiki/Internet_media_typehttp://en.wikipedia.org/wiki/Filename_extension
  • 8/10/2019 Json the Fatfree Alternative to Xml4594

    9/21

    Douglas Crockfordwas the first to specifyand popularize the JSON format

    TheJSON.orgWeb site was launched in 2002.

    In December 2005, Yahoo!began offeringsome of its Web servicesin JSON

    Googlestarted offering JSON feeds for itsGDataweb protocol in December 2006.

    http://en.wikipedia.org/wiki/Douglas_Crockfordhttp://json.org/http://en.wikipedia.org/wiki/Yahoo%21http://en.wikipedia.org/wiki/Web_servicehttp://en.wikipedia.org/wiki/Googlehttp://en.wikipedia.org/wiki/GDatahttp://en.wikipedia.org/wiki/GDatahttp://en.wikipedia.org/wiki/Googlehttp://en.wikipedia.org/wiki/Web_servicehttp://en.wikipedia.org/wiki/Yahoo%21http://json.org/http://en.wikipedia.org/wiki/Douglas_Crockford
  • 8/10/2019 Json the Fatfree Alternative to Xml4594

    10/21

    Strings Numbers

    Booleans

    Objects

    Arrays

    Null

  • 8/10/2019 Json the Fatfree Alternative to Xml4594

    11/21

    Sequence of 0 or more Unicode characters

    No separate character type A character is represented as a string with a length

    of 1

    Wrapped in "double quotes"

    Backslash escapement

  • 8/10/2019 Json the Fatfree Alternative to Xml4594

    12/21

    Integer Real

    Scientific

    No octal or hex

  • 8/10/2019 Json the Fatfree Alternative to Xml4594

    13/21

    True

    False

  • 8/10/2019 Json the Fatfree Alternative to Xml4594

    14/21

    var Pushkar = {

    "age" : "22",

    "hometown" : Aurangabad, MH","gender" : "male"

    };

    This creates an object that we access using the

    variable Pushkar

  • 8/10/2019 Json the Fatfree Alternative to Xml4594

    15/21

    document.write(Pushkar is ' Pushkar.age);

    // Output: Pushkar is 22

    document.write('Jason is a ' Pushkar.gender);// Output: Pushkar is a male

  • 8/10/2019 Json the Fatfree Alternative to Xml4594

    16/21

    Chinese

    English

    French

    German Italian

    Japanese

    Korean Spanish

  • 8/10/2019 Json the Fatfree Alternative to Xml4594

    17/21

    JSON XML

    Stands For JSON : JavaScript Object Notation. XML: Extensible Markup Language.

    Extended From JSON is extended from JavaScript. XML is extended from SGML:

    Standard Generalized Markup

    Language.

    Purpose JSON is one type of text-based format or

    standard for interchanging data i.e.human

    readable.

    XML is a Markup Languagehaving

    format that contains set of rules for the

    encoding the documents which is readable

    for both human & machine.

    Syntax

    JSON syntax is lighter than XML as JSONhas serialized format of data having less

    redundancy. JSON does not contain start and

    end tags.

    XML is not so lighter as JSON as havingstart and end tags and it takes more

    character than JSON to represent same

    data.

    Speed JSON is light weighted in compare to

    XML and so faster also.

    XML is not so light weighted as JSON. So

    it slower

    Support of Data Type

    JSON supports datatypeincluding integer

    and strings

    XML does not provide any data type so

    needs to be parsedinto particular data

    type

    CommentsJSON does not support Comments XML supports comments

    ApplicationFor Web services, JSON is better. For configuration, XML is better

    Changing Format

    You can not change JSON data to other

    format

    In XML, using XSLTyou can change

    XML data into another format like

    commadelimited, plain text, JSON, etc

  • 8/10/2019 Json the Fatfree Alternative to Xml4594

    18/21

    JSON is light weight component. It doesnttake more time for execution.

    It supports data structures used in modernlanguages.

    In Java script we cannot retrieve values from

    other files for example java.In JSON we can retrieve values fromanywhere. It supports all languages

  • 8/10/2019 Json the Fatfree Alternative to Xml4594

    19/21

    You can not change JSON data to otherformat.

    JSON Doesn't Have Namespaces.

    JSON Has No Validator.

    JSON Is Not Extensible.

  • 8/10/2019 Json the Fatfree Alternative to Xml4594

    20/21

    "Doug Crockford "Google Tech Talks:JavaScript: The Good Parts"

    "JSON: The Fat-Free Alternative to XML".json.org

    http://www.youtube.com/watch?v=hQVTIJBZookhttp://www.youtube.com/watch?v=hQVTIJBZookhttp://www.json.org/xml.htmlhttp://www.json.org/xml.htmlhttp://www.json.org/xml.htmlhttp://www.json.org/xml.htmlhttp://www.youtube.com/watch?v=hQVTIJBZookhttp://www.youtube.com/watch?v=hQVTIJBZook
  • 8/10/2019 Json the Fatfree Alternative to Xml4594

    21/21