WEBVTT

00:00.000 --> 00:03.000
In today's world of interconnected applications,

00:03.000 --> 00:05.840
data needs to move smoothly between systems.

00:05.840 --> 00:08.200
Whether it's a website fetching user data

00:08.200 --> 00:11.000
or a mobile app displaying weather updates,

00:11.000 --> 00:14.000
that's where Jason comes in.

00:14.000 --> 00:17.000
Jason, which stands for JavaScript Object Notation,

00:17.000 --> 00:19.400
is a lightweight data interchange format

00:19.400 --> 00:23.400
used to transfer information between a server and a client.

00:23.400 --> 00:26.300
Think of Jason as a universal language for data,

00:26.300 --> 00:28.300
easy for humans to read and write,

00:28.300 --> 00:32.800
and simple for machines to understand.

00:32.800 --> 00:34.300
Compared to XML,

00:34.300 --> 00:37.500
Jason is less verbose and easier to parse.

00:37.500 --> 00:39.300
It doesn't need complex tags,

00:39.300 --> 00:41.200
just simple key value pairs,

00:41.200 --> 00:42.700
making it the preferred format

00:42.700 --> 00:46.800
in most modern applications and APIs.

00:46.800 --> 00:50.100
Jason is built using a few simple building blocks,

00:50.100 --> 00:54.200
key value pairs like name, Alice,

00:54.200 --> 00:56.400
arrays to store lists of items,

00:56.500 --> 01:01.500
nested objects where one object contains another.

01:01.500 --> 01:03.800
It supports only a few data types,

01:03.800 --> 01:06.900
strings, numbers, bullions, null,

01:06.900 --> 01:09.100
arrays, and objects.

01:09.100 --> 01:12.400
Here's a quick example of Jason data.

01:12.400 --> 01:14.700
Each piece of data is clearly structured.

01:14.700 --> 01:16.900
Keys are always in double quotes,

01:16.900 --> 01:20.200
and values can be text, numbers, lists,

01:20.200 --> 01:22.200
or even other objects.

01:22.200 --> 01:24.100
Once you understand this structure,

01:24.100 --> 01:28.500
reading or writing Jason becomes very easy.

01:28.500 --> 01:31.700
Let's see how Jason is actually used in programming.

01:31.700 --> 01:34.200
In Java, developers often use libraries

01:34.200 --> 01:38.200
such as org.json or Jackson to work with Jason.

01:38.200 --> 01:41.000
Here, the object mapper converts the Jason string

01:41.000 --> 01:42.500
into a Java object,

01:42.500 --> 01:44.400
so you can easily access values

01:44.400 --> 01:47.400
like person.name in your code.

01:47.400 --> 01:49.300
In Python, it's even simpler

01:49.300 --> 01:53.000
because Python has a built-in Jason module.

01:53.000 --> 01:54.800
Here's an example.

01:54.800 --> 01:56.600
This code loads the Jason string

01:56.600 --> 01:58.200
into a Python dictionary

01:58.200 --> 02:00.700
and prints the value of name,

02:00.700 --> 02:05.700
which, in our example, would be Alice.

02:05.700 --> 02:07.300
Just like we can read Jason,

02:07.300 --> 02:08.900
we can also generate it.

02:08.900 --> 02:10.700
In both Java and Python,

02:10.700 --> 02:13.700
we can convert program data into Jason strings,

02:13.700 --> 02:17.200
a process called serialization.

02:17.200 --> 02:22.000
For instance, in Python,

02:22.000 --> 02:24.800
this turns a Python dictionary

02:24.800 --> 02:26.100
into a Jason string

02:26.100 --> 02:27.900
that can be sent to a web service

02:27.900 --> 02:29.900
or saved to a file.

02:29.900 --> 02:34.900
Take a given Jason string,

02:34.900 --> 02:36.700
representing a list of products,

02:36.700 --> 02:38.500
parse it in your chosen language,

02:38.500 --> 02:41.500
and print the product names and prices.

02:41.500 --> 02:43.700
This helps you understand

02:43.700 --> 02:45.800
how data travels between systems.

02:45.800 --> 02:47.700
Cleanly, consistently,

02:47.700 --> 02:50.600
and in a universally understood format.

02:50.600 --> 02:53.600
Jason is the bridge of data in the digital world.

02:53.600 --> 02:55.900
It's lightweight, easy to understand,

02:55.900 --> 03:00.000
and supported across every major programming language.

03:00.000 --> 03:02.800
From reading simple data like names and ages

03:02.800 --> 03:06.200
to sending complex information across web servers,

03:06.200 --> 03:10.000
Jason makes data exchange fast and reliable.

03:10.000 --> 03:11.900
By mastering Jason's syntax

03:11.900 --> 03:14.400
and learning how to parse and generate it,

03:14.400 --> 03:15.800
you're building a crucial skill

03:15.800 --> 03:19.300
for working with modern applications and APIs.

03:19.300 --> 03:22.000
The foundation of Smart Connected Systems.

