Replacing XML with JSON

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

1 comments

Comments 1 - 1 of 1 previous next Post a comment

Post a comment
Embed Video
Edit your comment Cancel

17 Favorites & 1 Group

Replacing XML with JSON - Presentation Transcript

  1. JSON
    • JavaScript Object Notation (JSON)
    • … Replacing XML with JSON
  2. Agendas
    • What is JSON?
    • Why JSON?
    • JSON resources
  3. What is JSON ?
    • Lightweight data-interchange format
      • Compared to XML
    • Simple format
      • Easy for humans to read and write
      • Easy for machines to parse and generate
    • JSON is a text format
      • Programming language independent
      • Uses conventions that are familiar to programmers of the C-family of languages, including C, C++, C#, Java, JavaScript, Perl, Python
  4. JSON AND AJAX
  5. JSON Structure
    • A collection of name/value pairs
      • In various languages, this is realized as an object, record, struct, dictionary, hash table, keyed list, or associative array
    • An ordered list of values
      • In most languages, this is realized as an array,vector, list, or sequence
    • These are universal data structures supported by most modern programming languages
  6. JSON is like XML because
    • They are both 'self-describing' meaning that values are named, and thus 'human readable'
    • Both are hierarchical. (i.e. You can have values within values.)
    • Both can be parsed and used by lots of programming languages
    • Both can be passed around using AJAX
  7. JSON is Unlike XML because
    • XML uses angle brackets, with a tag name at the start and end of an element: JSON uses squiggly brackets with the name only at the beginning of the element.
    • JSON is less verbose so it's definitely quicker for humans to write, and probably quicker for us to read.
    • JSON can be parsed trivially using the eval() procedure in JavaScript
    • JSON includes arrays {where each element doesn't have a name of its own}
    • In XML you can use any name you want for an element, in JSON you can't use reserved words from JavaScript
  8. Why JSON over XML?
    • Lighter and faster than XML as on-the-wire data format
    • JSON objects are typed while XML data is typeless
      • JSON types: string, number, array, boolean,
      • XML data are all string
    • Native data form for JavaScript code
      • XML data needed to be parsed and assigned to variables through tedious DOM APIs
        • Data is readily accessible as JSON objects in your JavaScript code
      • Retrieving values is as easy as reading from an object property in your JavaScript code
  9. JSON Resources
    • Introducing JSON
      • http://www.json.org/
    • JSON in JavaScript
      • http://www.json.org/js.html
    • J SON-RPC for the .NET Framework (JayRock)
      • http://jayrock.berlios.de/
    • Allows reading and writing of JSON objects from .NET
      • http://www.newtonsoft.com/products/json/
    • How to convert XML to JSON in ASP.NET C#
      • http://www.phdcc.com/xml2json.htm
  10. Thank You Have a nice day  Contact: Manish Mittal (manish@value-one.com)

+ Jonathan BoutelleJonathan Boutelle, 3 years ago

custom

7440 views, 17 favs, 4 embeds more stats

A barcampdelhi2 talk by Manish Mittal

More Info

© All Rights Reserved

Go to text version
  • Total Views 7440
    • 7431 on SlideShare
    • 9 from embeds
  • Comments 1
  • Favorites 17
  • Downloads 1
Most viewed embeds
  • 5 views on http://www.ajaxlines.com
  • 2 views on http://s3.amazonaws.com
  • 1 views on http://www.blogger.com
  • 1 views on http://localhost

more

All embeds
  • 5 views on http://www.ajaxlines.com
  • 2 views on http://s3.amazonaws.com
  • 1 views on http://www.blogger.com
  • 1 views on http://localhost

less

Flagged as inappropriate Flag as inappropriate
Flag as innappropriate

Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

Cancel

Categories

Groups / Events