Join Ketkee Aryamane for an in-depth discussion in this video JSON and its significance, part of Java EE 8: JSON-B.
So now let's understand why we need JSON. Let's look at this two tier architecture of an application. I have a database here and that RESTful API is talking to the database. This API may be built on a .net platform using the ASP.net MVC API's. And then when the RESTful API churns out data, it will display it on the Java server page, which come a under the Java enterprise umbrella. Both of these are different systems. Java and .net, but in spite of that, they are talking together.
Let's see how a 3D architecture looks like, you have a RESTful API communicating with the database, then you have a set of middleware API's let's say, which is written out in Python libraries, and then both of these systems lets say have to work together in order to display the data on the front end, which is the user interface, and that is backed up by a Java or maybe a Java enterprise framework like Spring Mvc, JSF strat, et cetera. Now in both of these architectures, do you understand that all of these blocks have to work together in harmony.
They have to collaborate, they have to communicate, so that they ultimately go and render the application to the end customers. Now each of these blocks, or each of these languages, or each of these platforms, has got a different way of working. Their own environment, semantics, their ways of storing data, everything is different. But at the end of the day, yes they have to communicate in order to satisfy the requirements of the customer. Which means they need a format of data exchange. Which each of these systems will understand.
Each one of them will be able to pass it, and then can word it into their own objects inside for further processing. That's exactly why we need JSON. JSON is that kind of a format which will be used to exchange data between these heterogeneous systems so that the end application is rendered to the customer. Now, which ever system let's say its SpiTAN, or .net, or Java, or any other the system any other language that you take, if it wants to transmit data to another system, then it will have convert data out of its own object to a JSON representation.
And whenever it receives data from any other system, it will receive a JSON representation which it'll have to convert back into it's own kind of object. So when we try to talk of JASON with the Java platform, when you can order Java object to a JASON representation, of course the process is called Production of JSON, or as we say technically serialization. And when it's the other way around, when you have a JSON object being converted to a Java object, the it is called Consumption of JSON, or as we say deserialization.
So across the industry, today we have these kind of multi-tier architectures in the picture. When you have different systems collaborating with each other they'll communicate wire this common data format which is JSON, and then help the customers have a wonderful experience for their applications. In the next video, we'll see the basic JSON types. And we will also see how JSON looks like the structures, et cetera.
- JSON and JSON-B API basics
- Default mapping
- Defining beans and data
- Customized mapping
- Customizing the order of serialized properties
- Customizing constructors
- Working with binary data
- Custom serializers and deserializers
- Demo: Using JSON-B in a web application