json
TRANSCRIPT
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
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
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
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
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
JSON vs XML❖ The number of new API using JSON is increasing and displacing XML
XML vs JSON
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.
JSON Structure
TEST CODE
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.
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”.