SlideShare ist ein Scribd-Unternehmen logo
1 von 20
Downloaden Sie, um offline zu lesen
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

Weitere ähnliche Inhalte

Was ist angesagt? (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
 

Ähnlich wie 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
 
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
 

Ähnlich wie 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
 
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
 
JSON
JSONJSON
JSON
 

Mehr von 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
 

Mehr von 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
 

Kürzlich hochgeladen

UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7DianaGray10
 
Building Your Own AI Instance (TBLC AI )
Building Your Own AI Instance (TBLC AI )Building Your Own AI Instance (TBLC AI )
Building Your Own AI Instance (TBLC AI )Brian Pichman
 
Building AI-Driven Apps Using Semantic Kernel.pptx
Building AI-Driven Apps Using Semantic Kernel.pptxBuilding AI-Driven Apps Using Semantic Kernel.pptx
Building AI-Driven Apps Using Semantic Kernel.pptxUdaiappa Ramachandran
 
OpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability AdventureOpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability AdventureEric D. Schabell
 
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPAAnypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPAshyamraj55
 
Computer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and HazardsComputer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and HazardsSeth Reyes
 
Comparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and IstioComparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and IstioChristian Posta
 
AI You Can Trust - Ensuring Success with Data Integrity Webinar
AI You Can Trust - Ensuring Success with Data Integrity WebinarAI You Can Trust - Ensuring Success with Data Integrity Webinar
AI You Can Trust - Ensuring Success with Data Integrity WebinarPrecisely
 
Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024D Cloud Solutions
 
9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding Team9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding TeamAdam Moalla
 
How Accurate are Carbon Emissions Projections?
How Accurate are Carbon Emissions Projections?How Accurate are Carbon Emissions Projections?
How Accurate are Carbon Emissions Projections?IES VE
 
UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8DianaGray10
 
Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024SkyPlanner
 
Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)Commit University
 
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationUsing IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationIES VE
 
Linked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond OntologiesLinked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond OntologiesDavid Newbury
 
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCostKubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCostMatt Ray
 
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...Will Schroeder
 

Kürzlich hochgeladen (20)

UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7
 
Building Your Own AI Instance (TBLC AI )
Building Your Own AI Instance (TBLC AI )Building Your Own AI Instance (TBLC AI )
Building Your Own AI Instance (TBLC AI )
 
Building AI-Driven Apps Using Semantic Kernel.pptx
Building AI-Driven Apps Using Semantic Kernel.pptxBuilding AI-Driven Apps Using Semantic Kernel.pptx
Building AI-Driven Apps Using Semantic Kernel.pptx
 
OpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability AdventureOpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability Adventure
 
201610817 - edge part1
201610817 - edge part1201610817 - edge part1
201610817 - edge part1
 
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPAAnypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPA
 
Computer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and HazardsComputer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and Hazards
 
Comparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and IstioComparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and Istio
 
AI You Can Trust - Ensuring Success with Data Integrity Webinar
AI You Can Trust - Ensuring Success with Data Integrity WebinarAI You Can Trust - Ensuring Success with Data Integrity Webinar
AI You Can Trust - Ensuring Success with Data Integrity Webinar
 
Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024
 
9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding Team9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding Team
 
How Accurate are Carbon Emissions Projections?
How Accurate are Carbon Emissions Projections?How Accurate are Carbon Emissions Projections?
How Accurate are Carbon Emissions Projections?
 
UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8
 
Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024
 
Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)
 
20150722 - AGV
20150722 - AGV20150722 - AGV
20150722 - AGV
 
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationUsing IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
 
Linked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond OntologiesLinked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond Ontologies
 
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCostKubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
 
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
 

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