BT

New JSON Binding Library Is Ready for Public Review

| by Abraham Marín Pérez Follow 8 Followers on Jun 20, 2016. Estimated reading time: 2 minutes |

JSON-B, the JSON binding library expected to be added to Java EE 8, has been released for public review. The library builds on top of JSON Processing (not to be confused with JSONP or JSON-with-padding), and intends to provide a standard alternative to popular libraries such as Jackson or Gson. The JSR is only targeted for inclusion in Java EE though, meaning users of Java SE will still need to make use of external libraries.

The JSON Processing library was added to Java EE 7 in 2013 in order to provide an API for JSON manipulation. Although JSON-P is useful to navigate and construct a JSON object, it has proven insufficient in satisfying the day-to-day needs of developers, who required an easier and more transparent way to convert a common Java object into JSON and vice versa.

In addition to representing only a partial solution, JSON Processing appeared after a number of third party tools had already emerged, among them Gson in 2008 and Jackson in 2009. These tools provide several integration mechanisms to interact with other Java EE components like JAX-RS, which makes them very popular in web application development. However, the spread of different available technologies makes it difficult to create portable applications, and the need for a standardised solution has become apparent. This was reflected in the Java EE 8 Community Survey of 2014, where a JSON binding tool was voted the highest priority for a new Java EE release. Given this, the JSR for JSON-B was created in August of that very year, with the intention of releasing it in the first half of 2017.

Despite the strong demand in the community for this kind of functionality, the library faces a number of risks that could prevent its adoption. On one hand, JSON Binding may be appearing just too late: the current plan of releasing in 2017 already implies a six months delay from the original schedule, which has translated into a six months delay of Java EE 8 itself. Not only this, the current schedule implies a delay of seven years with regards to the industry.

On the other hand, and as Tatu Saloranta, lead developer of Jackson, pointed out, the fact that JSON Binding is based in JSON Processing imposes limitations in its scope and extensibility. Saloranta discussed the possibility of re-implementing Jackson on top of JSON-B to try and make use of the new standard, but almost immediately discarded the possibility:

Both make it difficult to, for example, make Jackson implement or be based on JSON-B. In addition to the whole licensing limbo, the limited scope and extensibility means that much of what Jackson does, beyond simple JSON databinding, could not be exposed in a compatible manner.

The potentially reduced benefits of JSON-B adds weight to the mounting concerns that Java EE is not receiving enough attention, as was reflected in the minutes of a recent meeting of the JCP Executive Committee, and may contribute to transferring responsibilities over Java EE development to the community.

Rate this Article

Adoption Stage
Style

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

JSON-B is targeting Java EE as well as Java SE by Mahmoud Ben Hassine

> The JSR is only targeting Java EE though, meaning users of Java SE will still need to make use of third party libraries.

I'm not sure this is correct. JSON-B is also targeting Java SE as stated in section 2.2 of the JSR 367: jcp.org/en/jsr/detail?id=367

Re: JSON-B is targeting Java EE as well as Java SE by Abraham Marin-Perez

Hi Mahmoud,

I think my choice of words wasn't very fortunate. What I meant is that it's going to be included in Java EE 8 (as indicated in section 2.3), but not in Java SE. Section 2.2 indicates that the JSR will work with Java SE 7 or higher and Java EE 7 or higher, but not that it won't be included there.

I'll change the wording to clarify.

Re: JSON-B is targeting Java EE as well as Java SE by Mahmoud Ben Hassine

Hi Abraham,

Thank you for your quick reply. I see your point, I think the word "targeting" was confusing to me. I was waiting for Json-B to use it a Java SE app, and with this public review release, I can already give it a try. Good news! thanks for sharing.

Kind regards
Mahmoud

Re: JSON-B is targeting Java EE as well as Java SE by Abraham Marin-Perez

Hi Mahmoud,

Thank you for pointing it out :). You can use JSON-B, you'll just have to add it as an external library. I'm glad you found it useful.

Cheers,
Abraham

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

4 Discuss

Login to InfoQ to interact with what matters most to you.


Recover your password...

Follow

Follow your favorite topics and editors

Quick overview of most important highlights in the industry and on the site.

Like

More signal, less noise

Build your own feed by choosing topics you want to read about and editors you want to hear from.

Notifications

Stay up-to-date

Set up your notifications and don't miss out on content that matters to you

BT