SlideShare a Scribd company logo
1 of 20
Download to read offline
An Introduction to JSON
                             Ahmed Muzammil | @ahmedmzl
JavaScript Object Notation
                                     www.ahmedmzl.com | Ahmed Muzammil Jamal ] LinkedIn ] @ahmedmzl
What's inside
                     Introducing JSON
                         Why JSON
                      JSON Structures
                       Data in JSON
                   JSON Arrays, Objects
                JSON Values, String, Number
                    Tools for Developers
                    JSON Data Example




                                          www.ahmedmzl.com | Ahmed Muzammil Jamal ] LinkedIn ] @ahmedmzl
JavaScript Object Notation

The fat free alternative to XML




                                  www.ahmedmzl.com | Ahmed Muzammil Jamal ] LinkedIn ] @ahmedmzl
Why JSON ??

• It's easy for humans to read and write

• It's also easy for computers to read and parse

• JSON's structure is significantly simple.

• Parsing efficiency is more when compared to XML

• Lighter and faster than XML as on-the-wire data format



                                             www.ahmedmzl.com | Ahmed Muzammil Jamal ] LinkedIn ] @ahmedmzl
JSON objects are "typed" vs. XML is "typeless"


        XML                         JSON


         All
       Strings                                            boolean

                           string          array

                                number



                                           www.ahmedmzl.com | Ahmed Muzammil Jamal ] LinkedIn ] @ahmedmzl
JSON   JavaScript Object Notation

                www.ahmedmzl.com | Ahmed Muzammil Jamal ] LinkedIn ] @ahmedmzl
JSON ➡ Native data form for JavaScript

 • Data is readily accessible   • XML data needs parsing
   as JSON objects
                                • Needs to use tedious
 • Retrieving values from         DOM APIs and
   JSON is as easy as             processing power to
   importing an object in         assign to variables
   JavaScript




                                            www.ahmedmzl.com | Ahmed Muzammil Jamal ] LinkedIn ] @ahmedmzl
JSON is built on two structures

• A collection of name/value pairs
   • Realization (as in various programming languages)
       • Object, Record, Struct, Dictionary, HashTable, Keyed
         List, or Associative Array

• An ordered list of values. In most languages, this is realized
  as an array, vector, list, or sequence.
   • Realization (as in various programming languages
       • array, vector, list, or sequence

• JSON follows universal data structures
   • It is interoperable between programming languages

                                                www.ahmedmzl.com | Ahmed Muzammil Jamal ] LinkedIn ] @ahmedmzl
Data Storage In JSON

• Object




• Array




                       www.ahmedmzl.com | Ahmed Muzammil Jamal ] LinkedIn ] @ahmedmzl
JSON :: Object




• Example

 var myJSONObject =   { “Fruits” :
                                     [
                                     “Apple” ,
                                     “Orange”,
                                     “Grapes”
                                     ],
                      };


                                          www.ahmedmzl.com | Ahmed Muzammil Jamal ] LinkedIn ] @ahmedmzl
JSON :: Array




• Example

 var myJSONArray = [
                    “Apple” ,
                    “Orange”,
                    “Grapes”
                   ];

                                www.ahmedmzl.com | Ahmed Muzammil Jamal ] LinkedIn ] @ahmedmzl
JSON Values




              www.ahmedmzl.com | Ahmed Muzammil Jamal ] LinkedIn ] @ahmedmzl
JSON String

 • A string is very much like a C or Java string.
     • string is a collection of zero or more Unicode characters within double
       quotes and using backslash escapes
     • character is represented as a single character string




Eg.
“Ahmed Muzammil”
“”Jamal””
“nTest”
“uAF34u34DS”

                                                          www.ahmedmzl.com | Ahmed Muzammil Jamal ] LinkedIn ] @ahmedmzl
JSON Number

• A number is very much like a C or Java number
  ! octal and hexadecimal formats are not used.




Eg.
1234567
1.32432
0.342 e+12
1.23324342 e-32

                                        www.ahmedmzl.com | Ahmed Muzammil Jamal ] LinkedIn ] @ahmedmzl
JSON Tools for Developers

• Available for download @ www.json.org

• Parser
  Parse JSON text files and convert these to a Java model

• Renderer
  Render a Java representation into text

• Serializer
  Serialize plain POJO clusters to a JSON representation

• Validator
  Validate the contents of a JSON file using a JSON schema

• Tools are also available for other languages
    • ASP, ActionScript, C Family, ColdFusion, Delphi, JavaScript, Perl, PHP,
       PL/SQL, Ruby, Symbian & many more

                                                               www.ahmedmzl.com | Ahmed Muzammil Jamal ] LinkedIn ] @ahmedmzl
Where is JSON Used?

• Ajax applications / Web 2.0

• Represent configuration information

• Implement communication protocols

• Data Exchange

• Remote Procedure Call / RMI

• Service Oriented Architecture

                                       www.ahmedmzl.com | Ahmed Muzammil Jamal ] LinkedIn ] @ahmedmzl
Let’s end with an example JSON
 {   "firstName": "John",
     "lastName": "Smith",
     "age": 25,
     "address":    {
            "streetAddress": "21 2nd Street",
            "city": "New York",
            "state": "NY",
            "postalCode": "10021“
            },
     "phoneNumber": [
                {
                "type": "home",
                "number": "212 555-1234“
                },
                {
                "type": "fax",
                "number": "646 555-4567“
                }
            ]
 }


                                                www.ahmedmzl.com | Ahmed Muzammil Jamal ] LinkedIn ] @ahmedmzl
The same Example in XML

 <Object>
 <Property><Key>firstName</Key> <String>John</String></Property>
 <Property><Key>lastName</Key> <String>Smith</String></Property>
 <Property><Key>age</Key> <Number>25</Number></Property>
 <Property><Key>address</Key> <Object> <Property><Key>streetAddress</Key>
 <String>21 2nd Street</String></Property>
 <Property><Key>city</Key> <String>New York</String></Property>
 <Property><Key>state</Key> <String>NY</String></Property>
 <Property><Key>postalCode</Key> <String>10021</String></Property>
 </Object>
 </Property> <Property><Key>phoneNumber</Key>
 <Array> <Object> <Property><Key>type</Key> <String>home</String></Property>
 <Property><Key>number</Key> <String>212 555-1234</String></Property></Object>
 <Object>
 <Property><Key>type</Key> <String>fax</String></Property> <Property><Key>number</
 Key> <String>646 555-4567</String></Property> </Object> </Array>
 </Property>
 </Object>


                                                             www.ahmedmzl.com | Ahmed Muzammil Jamal ] LinkedIn ] @ahmedmzl
Want more of JSON ? Go here...

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

• Introduction to JSON
  - http://www.javapassion.com/ajax/JSON.pdf

• JSON in JavaScript
  - http://www.json.org/js.html

• JSON in Java
  - http://www.json.org/java/index.html

                                          www.ahmedmzl.com | Ahmed Muzammil Jamal ] LinkedIn ] @ahmedmzl
JSON is GOOD !

• Like this presentation? Share it...

• Questions?
  - Tweet me @ahmedmzl

• I can help you on:                        Buy a "I ♥ JSON Tshirt" like this here at zazzle.com



    • Service Oriented Architecture (SOA)
    • Business Process Management (BPM)
    • Business Intelligence (BI)
    • User Experience (UX)
    • Product Development
    • Project Management

                                                   www.ahmedmzl.com | Ahmed Muzammil Jamal ] LinkedIn ] @ahmedmzl

More Related Content

What's hot (20)

JSON-(JavaScript Object Notation)
JSON-(JavaScript Object Notation)JSON-(JavaScript Object Notation)
JSON-(JavaScript Object Notation)
 
Json
JsonJson
Json
 
JSON(JavaScript Object Notation)
JSON(JavaScript Object Notation)JSON(JavaScript Object Notation)
JSON(JavaScript Object Notation)
 
Json
JsonJson
Json
 
Json tutorial, a beguiner guide
Json tutorial, a beguiner guideJson tutorial, a beguiner guide
Json tutorial, a beguiner guide
 
Hands on JSON
Hands on JSONHands on JSON
Hands on JSON
 
Json
JsonJson
Json
 
ActiveRecord vs Mongoid
ActiveRecord vs MongoidActiveRecord vs Mongoid
ActiveRecord vs Mongoid
 
Json
JsonJson
Json
 
Using Mongoid with Ruby on Rails
Using Mongoid with Ruby on RailsUsing Mongoid with Ruby on Rails
Using Mongoid with Ruby on Rails
 
MongoDB and Ruby on Rails
MongoDB and Ruby on RailsMongoDB and Ruby on Rails
MongoDB and Ruby on Rails
 
Json - ideal for data interchange
Json - ideal for data interchangeJson - ideal for data interchange
Json - ideal for data interchange
 
Schema Design with MongoDB
Schema Design with MongoDBSchema Design with MongoDB
Schema Design with MongoDB
 
J s-o-n-120219575328402-3
J s-o-n-120219575328402-3J s-o-n-120219575328402-3
J s-o-n-120219575328402-3
 
Json
JsonJson
Json
 
Building web applications with mongo db presentation
Building web applications with mongo db presentationBuilding web applications with mongo db presentation
Building web applications with mongo db presentation
 
Json
JsonJson
Json
 
Comparing JSON Libraries - July 19 2011
Comparing JSON Libraries - July 19 2011Comparing JSON Libraries - July 19 2011
Comparing JSON Libraries - July 19 2011
 
Modeling Data in MongoDB
Modeling Data in MongoDBModeling Data in MongoDB
Modeling Data in MongoDB
 
java script json
java script jsonjava script json
java script json
 

Similar to An Introduction to JSON JavaScript Object Notation

3 web services bb
3   web services bb3   web services bb
3 web services bbShahid Riaz
 
AJAX, JSON, and Client-Side Templates
AJAX, JSON, and Client-Side TemplatesAJAX, JSON, and Client-Side Templates
AJAX, JSON, and Client-Side TemplatesRTigger
 
json.ppt download for free for college project
json.ppt download for free for college projectjson.ppt download for free for college project
json.ppt download for free for college projectAmitSharma397241
 
Web technologies-course 10.pptx
Web technologies-course 10.pptxWeb technologies-course 10.pptx
Web technologies-course 10.pptxStefan Oprea
 
PhDigital 2020: Web Development
PhDigital 2020: Web DevelopmentPhDigital 2020: Web Development
PhDigital 2020: Web DevelopmentCindy Royal
 
Introducing Azure DocumentDB - NoSQL, No Problem
Introducing Azure DocumentDB - NoSQL, No ProblemIntroducing Azure DocumentDB - NoSQL, No Problem
Introducing Azure DocumentDB - NoSQL, No ProblemAndrew Liu
 
Java Script Based Client Server Webapps 2
Java Script Based Client Server Webapps 2Java Script Based Client Server Webapps 2
Java Script Based Client Server Webapps 2kriszyp
 
BITM3730Week8.pptx
BITM3730Week8.pptxBITM3730Week8.pptx
BITM3730Week8.pptxMattMarino13
 
How to use Schema to enrich search results and improve your CTR - Andrew Mart...
How to use Schema to enrich search results and improve your CTR - Andrew Mart...How to use Schema to enrich search results and improve your CTR - Andrew Mart...
How to use Schema to enrich search results and improve your CTR - Andrew Mart...SearchNorwich
 
Service Oriented Architecture -Unit II - Modeling databases in xml
Service Oriented Architecture -Unit II - Modeling databases in xml Service Oriented Architecture -Unit II - Modeling databases in xml
Service Oriented Architecture -Unit II - Modeling databases in xml Roselin Mary S
 
JSON - (English)
JSON - (English)JSON - (English)
JSON - (English)Senior Dev
 
NAVTechDays 2017 Json Meets NAV
NAVTechDays 2017 Json Meets NAVNAVTechDays 2017 Json Meets NAV
NAVTechDays 2017 Json Meets NAVGunnar Gestsson
 

Similar to An Introduction to JSON JavaScript Object Notation (20)

Json
JsonJson
Json
 
3 web services bb
3   web services bb3   web services bb
3 web services bb
 
Java script and json
Java script and jsonJava script and json
Java script and json
 
AJAX, JSON, and Client-Side Templates
AJAX, JSON, and Client-Side TemplatesAJAX, JSON, and Client-Side Templates
AJAX, JSON, and Client-Side Templates
 
json.ppt download for free for college project
json.ppt download for free for college projectjson.ppt download for free for college project
json.ppt download for free for college project
 
Mongodb
MongodbMongodb
Mongodb
 
Web technologies-course 10.pptx
Web technologies-course 10.pptxWeb technologies-course 10.pptx
Web technologies-course 10.pptx
 
Ajax
Ajax Ajax
Ajax
 
PhDigital 2020: Web Development
PhDigital 2020: Web DevelopmentPhDigital 2020: Web Development
PhDigital 2020: Web Development
 
Neotys conference
Neotys conferenceNeotys conference
Neotys conference
 
JSON
JSONJSON
JSON
 
Introducing Azure DocumentDB - NoSQL, No Problem
Introducing Azure DocumentDB - NoSQL, No ProblemIntroducing Azure DocumentDB - NoSQL, No Problem
Introducing Azure DocumentDB - NoSQL, No Problem
 
Json training
Json trainingJson training
Json training
 
Java Script Based Client Server Webapps 2
Java Script Based Client Server Webapps 2Java Script Based Client Server Webapps 2
Java Script Based Client Server Webapps 2
 
BITM3730Week8.pptx
BITM3730Week8.pptxBITM3730Week8.pptx
BITM3730Week8.pptx
 
Json the-x-in-ajax1588
Json the-x-in-ajax1588Json the-x-in-ajax1588
Json the-x-in-ajax1588
 
How to use Schema to enrich search results and improve your CTR - Andrew Mart...
How to use Schema to enrich search results and improve your CTR - Andrew Mart...How to use Schema to enrich search results and improve your CTR - Andrew Mart...
How to use Schema to enrich search results and improve your CTR - Andrew Mart...
 
Service Oriented Architecture -Unit II - Modeling databases in xml
Service Oriented Architecture -Unit II - Modeling databases in xml Service Oriented Architecture -Unit II - Modeling databases in xml
Service Oriented Architecture -Unit II - Modeling databases in xml
 
JSON - (English)
JSON - (English)JSON - (English)
JSON - (English)
 
NAVTechDays 2017 Json Meets NAV
NAVTechDays 2017 Json Meets NAVNAVTechDays 2017 Json Meets NAV
NAVTechDays 2017 Json Meets NAV
 

More from Ahmed Muzammil

Islam on respecting others
Islam on respecting othersIslam on respecting others
Islam on respecting othersAhmed Muzammil
 
Children upbringing in Islam, Tiger and Panda Parenting
Children upbringing in Islam, Tiger and Panda ParentingChildren upbringing in Islam, Tiger and Panda Parenting
Children upbringing in Islam, Tiger and Panda ParentingAhmed Muzammil
 
What Islam Teaches You About Healthy Food - Healthy Foods and Myths
What Islam Teaches You About Healthy Food - Healthy Foods and MythsWhat Islam Teaches You About Healthy Food - Healthy Foods and Myths
What Islam Teaches You About Healthy Food - Healthy Foods and MythsAhmed Muzammil
 
Jaspersoft Reporting v5
Jaspersoft Reporting v5Jaspersoft Reporting v5
Jaspersoft Reporting v5Ahmed Muzammil
 
XML Security Using XSLT
XML Security Using XSLTXML Security Using XSLT
XML Security Using XSLTAhmed Muzammil
 
Element wise encryption of XML using XSLT
Element wise encryption of XML using XSLTElement wise encryption of XML using XSLT
Element wise encryption of XML using XSLTAhmed Muzammil
 
Virus detection based on virus throttle technology
Virus detection based on virus throttle technologyVirus detection based on virus throttle technology
Virus detection based on virus throttle technologyAhmed Muzammil
 
Virus detection based on virus throttle technology
Virus detection based on virus throttle technologyVirus detection based on virus throttle technology
Virus detection based on virus throttle technologyAhmed Muzammil
 

More from Ahmed Muzammil (8)

Islam on respecting others
Islam on respecting othersIslam on respecting others
Islam on respecting others
 
Children upbringing in Islam, Tiger and Panda Parenting
Children upbringing in Islam, Tiger and Panda ParentingChildren upbringing in Islam, Tiger and Panda Parenting
Children upbringing in Islam, Tiger and Panda Parenting
 
What Islam Teaches You About Healthy Food - Healthy Foods and Myths
What Islam Teaches You About Healthy Food - Healthy Foods and MythsWhat Islam Teaches You About Healthy Food - Healthy Foods and Myths
What Islam Teaches You About Healthy Food - Healthy Foods and Myths
 
Jaspersoft Reporting v5
Jaspersoft Reporting v5Jaspersoft Reporting v5
Jaspersoft Reporting v5
 
XML Security Using XSLT
XML Security Using XSLTXML Security Using XSLT
XML Security Using XSLT
 
Element wise encryption of XML using XSLT
Element wise encryption of XML using XSLTElement wise encryption of XML using XSLT
Element wise encryption of XML using XSLT
 
Virus detection based on virus throttle technology
Virus detection based on virus throttle technologyVirus detection based on virus throttle technology
Virus detection based on virus throttle technology
 
Virus detection based on virus throttle technology
Virus detection based on virus throttle technologyVirus detection based on virus throttle technology
Virus detection based on virus throttle technology
 

Recently uploaded

Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 

Recently uploaded (20)

Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 

An Introduction to JSON JavaScript Object Notation

  • 1. An Introduction to JSON Ahmed Muzammil | @ahmedmzl JavaScript Object Notation www.ahmedmzl.com | Ahmed Muzammil Jamal ] LinkedIn ] @ahmedmzl
  • 2. What's inside Introducing JSON Why JSON JSON Structures Data in JSON JSON Arrays, Objects JSON Values, String, Number Tools for Developers JSON Data Example www.ahmedmzl.com | Ahmed Muzammil Jamal ] LinkedIn ] @ahmedmzl
  • 3. JavaScript Object Notation The fat free alternative to XML www.ahmedmzl.com | Ahmed Muzammil Jamal ] LinkedIn ] @ahmedmzl
  • 4. Why JSON ?? • It's easy for humans to read and write • It's also easy for computers to read and parse • JSON's structure is significantly simple. • Parsing efficiency is more when compared to XML • Lighter and faster than XML as on-the-wire data format www.ahmedmzl.com | Ahmed Muzammil Jamal ] LinkedIn ] @ahmedmzl
  • 5. JSON objects are "typed" vs. XML is "typeless" XML JSON All Strings boolean string array number www.ahmedmzl.com | Ahmed Muzammil Jamal ] LinkedIn ] @ahmedmzl
  • 6. JSON JavaScript Object Notation www.ahmedmzl.com | Ahmed Muzammil Jamal ] LinkedIn ] @ahmedmzl
  • 7. JSON ➡ Native data form for JavaScript • Data is readily accessible • XML data needs parsing as JSON objects • Needs to use tedious • Retrieving values from DOM APIs and JSON is as easy as processing power to importing an object in assign to variables JavaScript www.ahmedmzl.com | Ahmed Muzammil Jamal ] LinkedIn ] @ahmedmzl
  • 8. JSON is built on two structures • A collection of name/value pairs • Realization (as in various programming languages) • Object, Record, Struct, Dictionary, HashTable, Keyed List, or Associative Array • An ordered list of values. In most languages, this is realized as an array, vector, list, or sequence. • Realization (as in various programming languages • array, vector, list, or sequence • JSON follows universal data structures • It is interoperable between programming languages www.ahmedmzl.com | Ahmed Muzammil Jamal ] LinkedIn ] @ahmedmzl
  • 9. Data Storage In JSON • Object • Array www.ahmedmzl.com | Ahmed Muzammil Jamal ] LinkedIn ] @ahmedmzl
  • 10. JSON :: Object • Example var myJSONObject = { “Fruits” : [ “Apple” , “Orange”, “Grapes” ], }; www.ahmedmzl.com | Ahmed Muzammil Jamal ] LinkedIn ] @ahmedmzl
  • 11. JSON :: Array • Example var myJSONArray = [ “Apple” , “Orange”, “Grapes” ]; www.ahmedmzl.com | Ahmed Muzammil Jamal ] LinkedIn ] @ahmedmzl
  • 12. JSON Values www.ahmedmzl.com | Ahmed Muzammil Jamal ] LinkedIn ] @ahmedmzl
  • 13. JSON String • A string is very much like a C or Java string. • string is a collection of zero or more Unicode characters within double quotes and using backslash escapes • character is represented as a single character string Eg. “Ahmed Muzammil” “”Jamal”” “nTest” “uAF34u34DS” www.ahmedmzl.com | Ahmed Muzammil Jamal ] LinkedIn ] @ahmedmzl
  • 14. JSON Number • A number is very much like a C or Java number ! octal and hexadecimal formats are not used. Eg. 1234567 1.32432 0.342 e+12 1.23324342 e-32 www.ahmedmzl.com | Ahmed Muzammil Jamal ] LinkedIn ] @ahmedmzl
  • 15. JSON Tools for Developers • Available for download @ www.json.org • Parser Parse JSON text files and convert these to a Java model • Renderer Render a Java representation into text • Serializer Serialize plain POJO clusters to a JSON representation • Validator Validate the contents of a JSON file using a JSON schema • Tools are also available for other languages • ASP, ActionScript, C Family, ColdFusion, Delphi, JavaScript, Perl, PHP, PL/SQL, Ruby, Symbian & many more www.ahmedmzl.com | Ahmed Muzammil Jamal ] LinkedIn ] @ahmedmzl
  • 16. Where is JSON Used? • Ajax applications / Web 2.0 • Represent configuration information • Implement communication protocols • Data Exchange • Remote Procedure Call / RMI • Service Oriented Architecture www.ahmedmzl.com | Ahmed Muzammil Jamal ] LinkedIn ] @ahmedmzl
  • 17. Let’s end with an example JSON { "firstName": "John", "lastName": "Smith", "age": 25, "address": { "streetAddress": "21 2nd Street", "city": "New York", "state": "NY", "postalCode": "10021“ }, "phoneNumber": [ { "type": "home", "number": "212 555-1234“ }, { "type": "fax", "number": "646 555-4567“ } ] } www.ahmedmzl.com | Ahmed Muzammil Jamal ] LinkedIn ] @ahmedmzl
  • 18. The same Example in XML <Object> <Property><Key>firstName</Key> <String>John</String></Property> <Property><Key>lastName</Key> <String>Smith</String></Property> <Property><Key>age</Key> <Number>25</Number></Property> <Property><Key>address</Key> <Object> <Property><Key>streetAddress</Key> <String>21 2nd Street</String></Property> <Property><Key>city</Key> <String>New York</String></Property> <Property><Key>state</Key> <String>NY</String></Property> <Property><Key>postalCode</Key> <String>10021</String></Property> </Object> </Property> <Property><Key>phoneNumber</Key> <Array> <Object> <Property><Key>type</Key> <String>home</String></Property> <Property><Key>number</Key> <String>212 555-1234</String></Property></Object> <Object> <Property><Key>type</Key> <String>fax</String></Property> <Property><Key>number</ Key> <String>646 555-4567</String></Property> </Object> </Array> </Property> </Object> www.ahmedmzl.com | Ahmed Muzammil Jamal ] LinkedIn ] @ahmedmzl
  • 19. Want more of JSON ? Go here... • Introducing JSON - http://www.json.org/ • Introduction to JSON - http://www.javapassion.com/ajax/JSON.pdf • JSON in JavaScript - http://www.json.org/js.html • JSON in Java - http://www.json.org/java/index.html www.ahmedmzl.com | Ahmed Muzammil Jamal ] LinkedIn ] @ahmedmzl
  • 20. JSON is GOOD ! • Like this presentation? Share it... • Questions? - Tweet me @ahmedmzl • I can help you on: Buy a "I ♥ JSON Tshirt" like this here at zazzle.com • Service Oriented Architecture (SOA) • Business Process Management (BPM) • Business Intelligence (BI) • User Experience (UX) • Product Development • Project Management www.ahmedmzl.com | Ahmed Muzammil Jamal ] LinkedIn ] @ahmedmzl