SlideShare a Scribd company logo
1 of 68
Download to read offline
JSON at Work -
                 Overview and Ecosystem
                               Tom Marrs
                                Architect




Tuesday, February 19, 13
Your Profile
                       Really?



                             What else?



                                    How?




Tuesday, February 19, 13
What’s The Point?

                       JSON -
                            much
                                more ...



Tuesday, February 19, 13
JSON Ecosystem




Tuesday, February 19, 13
Our Agenda




Tuesday, February 19, 13
We’re Not Covering
                                   :(-
                           REST


                           XML


                           SOA




Tuesday, February 19, 13
Where Are We?




Tuesday, February 19, 13
JSON Beginnings

                       www.json.org

                       2001 - Douglas Crockford

                       2006 - IETF - RFC 4627

                       The “x” in AJAX

                       Lightweight / simple structures




Tuesday, February 19, 13
That was Then ...
                       JSON for Speed   XML for Integration




Tuesday, February 19, 13
JSON Validation

                           Structure   Instance Document [Well-formed]




                           Semantics   Schema [Order, Person]




Tuesday, February 19, 13
This is Now
                       JSON for Speed   JSON for Integration




Tuesday, February 19, 13
JSON.org




Tuesday, February 19, 13
JSON Documents

                {
                           "thisIs": "My First JSON Doc"
                }




Tuesday, February 19, 13
JSON Data
                                      Structures
                           Name/Value (or Key/Value) Pairs


                           Objects


                           Arrays



Tuesday, February 19, 13
JSON Key/Value Pair

                {
                           "firstName": "John"
                }




Tuesday, February 19, 13
JSON Object
                {
                           "address" : {
                             "line1" : "555 Main Street",
                             "city" : "Denver",
                             "stateOrProvince" : "CO",
                             "zipOrPostalCode" : "80202",
                             "country" : "USA"
                           }
                }


Tuesday, February 19, 13
JSON Array
                "clubs" : [
                  {
                     "number" : 677476,
                     "name" : "Simply Speaking",
                     "city" : "Aurora",
                     "district" : 26
                  },
                  {
                     "number" : 999999,
                     "name" : "Wry Toast",
                     "city" : "Denver",
                     "district" : 26
                  }
                ]




Tuesday, February 19, 13
JSON Value Types




Tuesday, February 19, 13
Numbers
                      "age": 29
                      "cost": 299.99
                      "temperature": -10.5
                      "speed_of_light": 1.23e11
                      "speed_of_light": 1.23e+11
                      "speed_of_light": 1.23E11
                      "speed_of_light": 1.23E+11



Tuesday, February 19, 13
JSON Boolean

                {
                           "emailValidated": true
                }




Tuesday, February 19, 13
null
                {
                           "address": {
                             "line1": "555 Main St.",
                             "line2": null,
                             "city": "Bailey",
                             "state": "CO",
                             "postalCode": 80909,
                             "country": "USA"
                           }
                }


Tuesday, February 19, 13
JSON Comments


                                No


Tuesday, February 19, 13
JSON Versions


                               Never


Tuesday, February 19, 13
A Bigger Sample
                 {
                     "member": {
                       "firstName": "John",
                       "lastName": "Smith",
                       "joined": "2008-12-06",
                       "language": "US English",
                       "reason": "To improve my public speaking skills. To take over the world.",
                       "address": {
                          "line1": "555 Main St.",
                          "city": "Bailey",
                          "state": "CO",
                          "postalCode": 80909,
                          "country": "USA"
                       },
                       "contact": {
                          "email": "john.smith@acme.com",
                          "homePhone": "303-555-1212",
                          "cellPhone": "720-555-1212",
                          "workPhone": "970-555-1212"
                       },
                       "club": {
                          "number": 677476,
                          "name": "Simply Speaking",
                          "city": "Aurora",
                          "district": 26
                       }
                     }
                 }




Tuesday, February 19, 13
Google JSON Style
                                 Guide




Tuesday, February 19, 13
Property Names


                {
                       "somePropertyIdentifier": "some value"
                }




Tuesday, February 19, 13
Date Property Values
                      - RFC 3399

                {
                       "dateJoined": "2007-11-06T16:34:41.000Z"
                }




Tuesday, February 19, 13
JSON Dominates the
                       Formats!




Tuesday, February 19, 13
JSON is Hot!




Tuesday, February 19, 13
Where Are We?




Tuesday, February 19, 13
JSON Tool Runtimes




Tuesday, February 19, 13
JSON Validators

                           JSON Validator (Mac)


                           http://www.jsonlint.com




Tuesday, February 19, 13
JSONLint.com




Tuesday, February 19, 13
JSON Beautifiers
                       Firefox      Chrome

                       JSONView     JSONView

                                    JSON SH




Tuesday, February 19, 13
JSON Without a
                             Beautifier




Tuesday, February 19, 13
JSONView




Tuesday, February 19, 13
JSON SH




Tuesday, February 19, 13
JSON Modeling Tools
                       JSON Designer              http://
                                                  www.jsonschema.net


                       JSONPad
                                                  Overly - Generate
                                                  Schema

                       http://
                       www.jsoneditoronline.org
                                                  Matic - Generate HTML




Tuesday, February 19, 13
Model JSON Doc -
                              JSONPad




Tuesday, February 19, 13
Model JSON Doc -
                       jsoneditoronline.org




Tuesday, February 19, 13
JSON Tutorial - on
                              the iPhone




Tuesday, February 19, 13
JSON Designer - on
                         the iPhone




Tuesday, February 19, 13
JSON and HTML5 &
                        JavaScript




Tuesday, February 19, 13
JSON and HTML5 &
                      JavaScript - AJAX

                      $.getJSON('http://example/service/addresses/home/1',
                        function(data) {
                          var address = JSON.parse(data);

                               console.log("Address Line 1 = " + address.line1);
                           }
                      );




Tuesday, February 19, 13
JSON and HTML5
                             Web Storage




Tuesday, February 19, 13
JSON Schema




Tuesday, February 19, 13
JSON Schema

                           Defines JSON document structure


                           http://json-schema.org/




Tuesday, February 19, 13
When To Use JSON
                          Schema?


                           When crossing organizational boundaries




Tuesday, February 19, 13
When NOT to use
                           JSON Schema?


                             Get a life - it’s just a website!




Tuesday, February 19, 13
JSON Schema
                                   Constructs
                           Construct                        Description

                type                   The data type – object, array, string, number, etc.


                required               true / false


                id                     Data element id

                                       Additional validation properties for a data element (e.g.,
                properties
                                       minimum, maximum, etc.)




Tuesday, February 19, 13
JSON Schema
                                 Validators
                JSON Schema
                            Language Source
                Validator

                JSV             JavaScript   https://github.com/garycourt/JSV

                Ruby JSON
                                 Ruby        https://github.com/hoxworth/json-schema
                Schema Validator

                json-schema-
                                Java         https://github.com/fge/json-schema-validator
                validator

                php-json-schema
                                PHP          https://github.com/hasbridge/php-json-schema
                (by MIT)

                JSON.Net        .NET         http://james.newtonking.com/projects/json-net.aspx

Tuesday, February 19, 13
JSON Schema
                             Example


                           Gift Registry Document & Schema




Tuesday, February 19, 13
JSON Modeling Flow




Tuesday, February 19, 13
Create JSON Schema
                    - jsonschema.net




Tuesday, February 19, 13
Create JSON Schema
                        - Orderly




Tuesday, February 19, 13
Validate JSON Document
                            against JSON Schema




Tuesday, February 19, 13
Generate HTML Document
                   from JSON Schema - Matic




Tuesday, February 19, 13
Where Are We?




Tuesday, February 19, 13
RESTing with JSON




Tuesday, February 19, 13
Where Are We?




Tuesday, February 19, 13
Text Search with
                                  JSON
                           JSONQuery


                           JSONPath


                           JSONiq



Tuesday, February 19, 13
Our Agenda




Tuesday, February 19, 13
What’s The Point?

                       JSON -
                            much
                                more ...



Tuesday, February 19, 13
Questions?
                       Tom Marrs

                       Architect

                       thomasamarrs@comcast.net

                       http://www.linkedin.com/in/
                       TomMarrs

                       Twitter: @TomMarrs

                       Skype: t.marrs




Tuesday, February 19, 13
JSON Resources
                           JSON Spec - http://tools.ietf.org/html/rfc4627


                           JSON.org - http://www.json.org


                           JSONLint - http://www.jsonlint.com


                           JSON Editor Online - http://jsoneditoronline.org/




Tuesday, February 19, 13
JSON Resources
                           JSON SH - http://jsonsh.com/



                           JSON Schema Generator - http://jsonschema.net



                           JSON Schema Validator - http://json-schema-validator.herokuapp.com/



                           JSON Schema Spec - http://tools.ietf.org/html/draft-zyp-json-schema-03



                           Google JSON Style Guide - http://google-styleguide.googlecode.com/svn/trunk/
                           jsoncstyleguide.xml




Tuesday, February 19, 13
JSON Resources
                           JSONQuery - https://github.com/jcrosby/jsonquery



                           JSONPath - http://goessner.net/articles/JsonPath/



                           JSONiq - http://www.jsoniq.org/



                           JSONT - http://goessner.net/articles/jsont/




Tuesday, February 19, 13
JSON Groups
                           Google - http://groups.google.com/group/json-schema



                           Yahoo! - http://tech.groups.yahoo.com/group/json/




Tuesday, February 19, 13

More Related Content

Viewers also liked

Java Script Object Notation (JSON)
Java Script Object Notation (JSON)Java Script Object Notation (JSON)
Java Script Object Notation (JSON)Adnan Sohail
 
Json-based Service Oriented Architecture for the web
Json-based Service Oriented Architecture for the webJson-based Service Oriented Architecture for the web
Json-based Service Oriented Architecture for the webkriszyp
 
Security problems in TCP/IP
Security problems in TCP/IPSecurity problems in TCP/IP
Security problems in TCP/IPSukh Sandhu
 
External Data Access with jQuery
External Data Access with jQueryExternal Data Access with jQuery
External Data Access with jQueryDoncho Minkov
 
Simplify AJAX using jQuery
Simplify AJAX using jQuerySimplify AJAX using jQuery
Simplify AJAX using jQuerySiva Arunachalam
 
Web technologies lesson 1
Web technologies   lesson 1Web technologies   lesson 1
Web technologies lesson 1nhepner
 
JSON: The Basics
JSON: The BasicsJSON: The Basics
JSON: The BasicsJeff Fox
 
An introduction to microsoft office 2007 lecture
An introduction to microsoft office 2007 lectureAn introduction to microsoft office 2007 lecture
An introduction to microsoft office 2007 lectureSukh Sandhu
 
introduction to web technology
introduction to web technologyintroduction to web technology
introduction to web technologyvikram singh
 
Introduction to Web Technology
Introduction to Web TechnologyIntroduction to Web Technology
Introduction to Web TechnologyRob Bertholf
 
Building Construction
Building ConstructionBuilding Construction
Building ConstructionWilden How
 
How to write a good business letter
How to write a good business letter   How to write a good business letter
How to write a good business letter Sukh Sandhu
 

Viewers also liked (19)

Java Script Object Notation (JSON)
Java Script Object Notation (JSON)Java Script Object Notation (JSON)
Java Script Object Notation (JSON)
 
Json-based Service Oriented Architecture for the web
Json-based Service Oriented Architecture for the webJson-based Service Oriented Architecture for the web
Json-based Service Oriented Architecture for the web
 
Security problems in TCP/IP
Security problems in TCP/IPSecurity problems in TCP/IP
Security problems in TCP/IP
 
Introduction to JSON
Introduction to JSONIntroduction to JSON
Introduction to JSON
 
Advanced Json
Advanced JsonAdvanced Json
Advanced Json
 
Json
JsonJson
Json
 
Json tutorial
Json tutorialJson tutorial
Json tutorial
 
Introduction to Advanced Javascript
Introduction to Advanced JavascriptIntroduction to Advanced Javascript
Introduction to Advanced Javascript
 
Introduction to JSON & AJAX
Introduction to JSON & AJAXIntroduction to JSON & AJAX
Introduction to JSON & AJAX
 
External Data Access with jQuery
External Data Access with jQueryExternal Data Access with jQuery
External Data Access with jQuery
 
Simplify AJAX using jQuery
Simplify AJAX using jQuerySimplify AJAX using jQuery
Simplify AJAX using jQuery
 
Introduction to jQuery
Introduction to jQueryIntroduction to jQuery
Introduction to jQuery
 
Web technologies lesson 1
Web technologies   lesson 1Web technologies   lesson 1
Web technologies lesson 1
 
JSON: The Basics
JSON: The BasicsJSON: The Basics
JSON: The Basics
 
An introduction to microsoft office 2007 lecture
An introduction to microsoft office 2007 lectureAn introduction to microsoft office 2007 lecture
An introduction to microsoft office 2007 lecture
 
introduction to web technology
introduction to web technologyintroduction to web technology
introduction to web technology
 
Introduction to Web Technology
Introduction to Web TechnologyIntroduction to Web Technology
Introduction to Web Technology
 
Building Construction
Building ConstructionBuilding Construction
Building Construction
 
How to write a good business letter
How to write a good business letter   How to write a good business letter
How to write a good business letter
 

Json at work overview and ecosystem-v2.1

  • 1. JSON at Work - Overview and Ecosystem Tom Marrs Architect Tuesday, February 19, 13
  • 2. Your Profile Really? What else? How? Tuesday, February 19, 13
  • 3. What’s The Point? JSON - much more ... Tuesday, February 19, 13
  • 6. We’re Not Covering :(- REST XML SOA Tuesday, February 19, 13
  • 7. Where Are We? Tuesday, February 19, 13
  • 8. JSON Beginnings www.json.org 2001 - Douglas Crockford 2006 - IETF - RFC 4627 The “x” in AJAX Lightweight / simple structures Tuesday, February 19, 13
  • 9. That was Then ... JSON for Speed XML for Integration Tuesday, February 19, 13
  • 10. JSON Validation Structure Instance Document [Well-formed] Semantics Schema [Order, Person] Tuesday, February 19, 13
  • 11. This is Now JSON for Speed JSON for Integration Tuesday, February 19, 13
  • 13. JSON Documents { "thisIs": "My First JSON Doc" } Tuesday, February 19, 13
  • 14. JSON Data Structures Name/Value (or Key/Value) Pairs Objects Arrays Tuesday, February 19, 13
  • 15. JSON Key/Value Pair { "firstName": "John" } Tuesday, February 19, 13
  • 16. JSON Object { "address" : { "line1" : "555 Main Street", "city" : "Denver", "stateOrProvince" : "CO", "zipOrPostalCode" : "80202", "country" : "USA" } } Tuesday, February 19, 13
  • 17. JSON Array "clubs" : [ { "number" : 677476, "name" : "Simply Speaking", "city" : "Aurora", "district" : 26 }, { "number" : 999999, "name" : "Wry Toast", "city" : "Denver", "district" : 26 } ] Tuesday, February 19, 13
  • 18. JSON Value Types Tuesday, February 19, 13
  • 19. Numbers "age": 29 "cost": 299.99 "temperature": -10.5 "speed_of_light": 1.23e11 "speed_of_light": 1.23e+11 "speed_of_light": 1.23E11 "speed_of_light": 1.23E+11 Tuesday, February 19, 13
  • 20. JSON Boolean { "emailValidated": true } Tuesday, February 19, 13
  • 21. null { "address": { "line1": "555 Main St.", "line2": null, "city": "Bailey", "state": "CO", "postalCode": 80909, "country": "USA" } } Tuesday, February 19, 13
  • 22. JSON Comments No Tuesday, February 19, 13
  • 23. JSON Versions Never Tuesday, February 19, 13
  • 24. A Bigger Sample { "member": { "firstName": "John", "lastName": "Smith", "joined": "2008-12-06", "language": "US English", "reason": "To improve my public speaking skills. To take over the world.", "address": { "line1": "555 Main St.", "city": "Bailey", "state": "CO", "postalCode": 80909, "country": "USA" }, "contact": { "email": "john.smith@acme.com", "homePhone": "303-555-1212", "cellPhone": "720-555-1212", "workPhone": "970-555-1212" }, "club": { "number": 677476, "name": "Simply Speaking", "city": "Aurora", "district": 26 } } } Tuesday, February 19, 13
  • 25. Google JSON Style Guide Tuesday, February 19, 13
  • 26. Property Names { "somePropertyIdentifier": "some value" } Tuesday, February 19, 13
  • 27. Date Property Values - RFC 3399 { "dateJoined": "2007-11-06T16:34:41.000Z" } Tuesday, February 19, 13
  • 28. JSON Dominates the Formats! Tuesday, February 19, 13
  • 29. JSON is Hot! Tuesday, February 19, 13
  • 30. Where Are We? Tuesday, February 19, 13
  • 31. JSON Tool Runtimes Tuesday, February 19, 13
  • 32. JSON Validators JSON Validator (Mac) http://www.jsonlint.com Tuesday, February 19, 13
  • 34. JSON Beautifiers Firefox Chrome JSONView JSONView JSON SH Tuesday, February 19, 13
  • 35. JSON Without a Beautifier Tuesday, February 19, 13
  • 38. JSON Modeling Tools JSON Designer http:// www.jsonschema.net JSONPad Overly - Generate Schema http:// www.jsoneditoronline.org Matic - Generate HTML Tuesday, February 19, 13
  • 39. Model JSON Doc - JSONPad Tuesday, February 19, 13
  • 40. Model JSON Doc - jsoneditoronline.org Tuesday, February 19, 13
  • 41. JSON Tutorial - on the iPhone Tuesday, February 19, 13
  • 42. JSON Designer - on the iPhone Tuesday, February 19, 13
  • 43. JSON and HTML5 & JavaScript Tuesday, February 19, 13
  • 44. JSON and HTML5 & JavaScript - AJAX $.getJSON('http://example/service/addresses/home/1', function(data) { var address = JSON.parse(data); console.log("Address Line 1 = " + address.line1); } ); Tuesday, February 19, 13
  • 45. JSON and HTML5 Web Storage Tuesday, February 19, 13
  • 47. JSON Schema Defines JSON document structure http://json-schema.org/ Tuesday, February 19, 13
  • 48. When To Use JSON Schema? When crossing organizational boundaries Tuesday, February 19, 13
  • 49. When NOT to use JSON Schema? Get a life - it’s just a website! Tuesday, February 19, 13
  • 50. JSON Schema Constructs Construct Description type The data type – object, array, string, number, etc. required true / false id Data element id Additional validation properties for a data element (e.g., properties minimum, maximum, etc.) Tuesday, February 19, 13
  • 51. JSON Schema Validators JSON Schema Language Source Validator JSV JavaScript https://github.com/garycourt/JSV Ruby JSON Ruby https://github.com/hoxworth/json-schema Schema Validator json-schema- Java https://github.com/fge/json-schema-validator validator php-json-schema PHP https://github.com/hasbridge/php-json-schema (by MIT) JSON.Net .NET http://james.newtonking.com/projects/json-net.aspx Tuesday, February 19, 13
  • 52. JSON Schema Example Gift Registry Document & Schema Tuesday, February 19, 13
  • 53. JSON Modeling Flow Tuesday, February 19, 13
  • 54. Create JSON Schema - jsonschema.net Tuesday, February 19, 13
  • 55. Create JSON Schema - Orderly Tuesday, February 19, 13
  • 56. Validate JSON Document against JSON Schema Tuesday, February 19, 13
  • 57. Generate HTML Document from JSON Schema - Matic Tuesday, February 19, 13
  • 58. Where Are We? Tuesday, February 19, 13
  • 59. RESTing with JSON Tuesday, February 19, 13
  • 60. Where Are We? Tuesday, February 19, 13
  • 61. Text Search with JSON JSONQuery JSONPath JSONiq Tuesday, February 19, 13
  • 63. What’s The Point? JSON - much more ... Tuesday, February 19, 13
  • 64. Questions? Tom Marrs Architect thomasamarrs@comcast.net http://www.linkedin.com/in/ TomMarrs Twitter: @TomMarrs Skype: t.marrs Tuesday, February 19, 13
  • 65. JSON Resources JSON Spec - http://tools.ietf.org/html/rfc4627 JSON.org - http://www.json.org JSONLint - http://www.jsonlint.com JSON Editor Online - http://jsoneditoronline.org/ Tuesday, February 19, 13
  • 66. JSON Resources JSON SH - http://jsonsh.com/ JSON Schema Generator - http://jsonschema.net JSON Schema Validator - http://json-schema-validator.herokuapp.com/ JSON Schema Spec - http://tools.ietf.org/html/draft-zyp-json-schema-03 Google JSON Style Guide - http://google-styleguide.googlecode.com/svn/trunk/ jsoncstyleguide.xml Tuesday, February 19, 13
  • 67. JSON Resources JSONQuery - https://github.com/jcrosby/jsonquery JSONPath - http://goessner.net/articles/JsonPath/ JSONiq - http://www.jsoniq.org/ JSONT - http://goessner.net/articles/jsont/ Tuesday, February 19, 13
  • 68. JSON Groups Google - http://groups.google.com/group/json-schema Yahoo! - http://tech.groups.yahoo.com/group/json/ Tuesday, February 19, 13