json
TRANSCRIPT
![Page 1: Json](https://reader036.vdocuments.net/reader036/viewer/2022070321/558fd9701a28ab77528b45ae/html5/thumbnails/1.jpg)
Prepared for Dr. Azrul Hazri bin Jantan Present by Zainal Abdul Kahar
JSON Discovering JavaScript Object Notation
Review!Computing Conversations!By Charles Severance!University of Michigan
![Page 2: Json](https://reader036.vdocuments.net/reader036/viewer/2022070321/558fd9701a28ab77528b45ae/html5/thumbnails/2.jpg)
Background❖ Discovered by Douglas Crockford self-
appointed evangelist!
❖ Invent and applying JSON in 2001 at State Software!
❖ Create a webpage to make it as standard!
❖ Popular format for data serialisation!
❖ Extensively use to encode data for transfer between server and Ajax application, to connect two servers communicating via web services
![Page 3: Json](https://reader036.vdocuments.net/reader036/viewer/2022070321/558fd9701a28ab77528b45ae/html5/thumbnails/3.jpg)
Introduction
❖ JSON (JavaScript Object Notation) is a lightweight data-interchange format. It is easy for humans to read and write and easy for machines to parse and generate!
❖ It is based on a subset of the JavaScript Programming Language!
❖ JSON is a text format that is completely language independent but uses conventions that are familiar to programmers of the C-family of languages, including C, C++, C#, Java, JavaScript, Perl, Python, and many others
![Page 4: Json](https://reader036.vdocuments.net/reader036/viewer/2022070321/558fd9701a28ab77528b45ae/html5/thumbnails/4.jpg)
Data exchange❖ The most common structures use in programming are scalar variables, linear
lists and key-value pair!
❖ JSON represents these structures in a form of direct serialisation!
❖ Greatly reduce the mismatch between in memory structure in application and the serialisation format!
❖ JSON is convenient and efficient!
❖ Using JSON in JavaScript gives advantage compared of using other format such as XML
![Page 5: Json](https://reader036.vdocuments.net/reader036/viewer/2022070321/558fd9701a28ab77528b45ae/html5/thumbnails/5.jpg)
JSON vs XML
❖ It is a constant debate between JSON and XML for the right formatting for data representation!
❖ XML is an enterprise solution with many toolset for manipulation!
❖ JSON slowly displacing XML as the preferred way for data exchange!
❖ JSON has the natural advantage as a serialisation format which exactly the same as data structures that programming language represent
![Page 6: Json](https://reader036.vdocuments.net/reader036/viewer/2022070321/558fd9701a28ab77528b45ae/html5/thumbnails/6.jpg)
JSON vs XML❖ The number of new API using JSON is increasing and displacing XML
![Page 7: Json](https://reader036.vdocuments.net/reader036/viewer/2022070321/558fd9701a28ab77528b45ae/html5/thumbnails/7.jpg)
XML vs JSON
![Page 8: Json](https://reader036.vdocuments.net/reader036/viewer/2022070321/558fd9701a28ab77528b45ae/html5/thumbnails/8.jpg)
JSON Structure
❖ JSON is built on two structures:!
❖ A collection of name/value pairs. In various languages, this is realised as an object, record, struct, dictionary, hash table, keyed list, or associative array.!
❖ An ordered list of values. In most languages, this is realised as an array, vector, list, or sequence.
![Page 10: Json](https://reader036.vdocuments.net/reader036/viewer/2022070321/558fd9701a28ab77528b45ae/html5/thumbnails/10.jpg)
JSON Structure
![Page 11: Json](https://reader036.vdocuments.net/reader036/viewer/2022070321/558fd9701a28ab77528b45ae/html5/thumbnails/11.jpg)
![Page 12: Json](https://reader036.vdocuments.net/reader036/viewer/2022070321/558fd9701a28ab77528b45ae/html5/thumbnails/12.jpg)
TEST CODE
![Page 14: Json](https://reader036.vdocuments.net/reader036/viewer/2022070321/558fd9701a28ab77528b45ae/html5/thumbnails/14.jpg)
Security
❖ Although JSON is intended solely as a data serialisation format, its design as a non-strict subset of the JavaScript scripting language poses several security concerns. These concerns centre on the use of a JavaScript interpreter to execute JSON text dynamically as embedded JavaScript. This exposes a program to errant or malicious scripts. This is a serious issue when dealing with data retrieved from the Internet.
![Page 15: Json](https://reader036.vdocuments.net/reader036/viewer/2022070321/558fd9701a28ab77528b45ae/html5/thumbnails/15.jpg)
Future of JSON
❖ According to Charles, once the programmer switch to JSON, they seldom get back to XML!
❖ The more programmers use JSON, the requirement for schema for JSON’s object grows!
❖ There are effort to add value to JSON without changing it such as “JSON for linked data”.