JSR 367: Java API for JSON Binding (JSON-B)

JSR 367 is one of the newly proposed JSRs posted in the July & August JSR Updates all of which are targeting the Java EE platform.

The JSR 367 or Java API for JSON Binding (JSON-B) specification is led by Oracle’s Martin Grebac and started its review in September 2014. The growing popularity of JSON being used by most systems and layers and the release of .JSR 353 or Java API for JSON Processing (JSON-P), are the reasons why JSR 367 was born. While JSR 353 developed a standard Java API for parsing, generating, and transforming JSON data, JSR 367 was proposed to develop “a standard binding layer for converting Java objects to/from JSON messages”. It is said that “JSON-B will leverage JSON-P and provide a conversion layer above it”.

The proposed package name is: javax.json.bind

This JSR was presented in the recently held JavaOne Conference, an event by Oracle. Grebac posted his approved slides on their blog site. The list of advantages of having Standard API below is an excerpt from his slides:

  • Switch providers easily
  • Implementation complete on common ground (performance or feature-wise)
  • Loss of implementation/participant is no issue for standard
  • More people able to help on forums or stackoverflow, even those not using your implementation of choice

The slides also contain the JSR’s description, status, goals and non-goals and other plans for the JSR.

Java SE 7 or higher and Java EE 7 or higher platforms are targeted by this JSR. They are also planning to include this in the Java EE 8. This API is said to have a “similar feel” to JAXB (Java Architecture for XML Binding). Therefore, developers of Java SE and Java EE could easily adopt JSON-B. Formation of the Expert Group started last October and the final release is scheduled on the 3rd quarter of 2016.

Updates on schedules will be posted in this link, while you can use users@jsonb-spec.java.net to post comments on their public mailing list.

Project Valhalla

Valhalla – For those who played Valkyrie Profile (an RPG for PlayStation released in 1999 whose story was based on the Norse Mythology) would know that it is a huge hall or also called “the hall of the slain” in Asgard that houses chosen dead people who will help god Odin in the event of Ragnarok.

However, in the world of Java, Valhalla a.k.a. Project Valhalla is not really a hall but rather a place to “explore and incubate advanced Java VM and Language feature candidates such as Value Types, Generic Specialization and enhanced volatiles” instead of housing dead people. Project Valhalla is a project led by Oracle’s Java Language Architect Brian Goetz and sponsored by the HotSpot Group which has been proposed and announced on the OpenJDK mailing list in July 10, 2014.

The current versions of Java use the “type erasure” approach to generic typing which gained criticism among the features of Java’s type system because it “only allows generic types to contain reference types, and the Java compiler removes the details of the contained type during compilation”. Therefore, one of the initial proposed features of Valhalla is the Generic Specialization , an enhancement to the Java Language that will support generics over primitives. You can read additional information about this feature on this draft.

Value Types is another main feature proposed for Valhalla. An initial draft called State of the Values written by John Rose, Brian Goetz, and Guy Steele was released in April 2014. It is an enhancement for the Java Virtual Machine that aims “to support small immutable, identityless value types”.

Unfortunately, none of the features will be in Java 9 but Goetz is hoping that their explorations will lead to the inclusion of Valhalla in Java’s future releases.

They will soon start the experimentation or trial and error through prototyping of these features and Goetz reminded that first rounds of prototypes will probably not show the final result.

To those interested developers who want to join Valhalla’s technical discussions or get updates, you can subscribe at valhalla-dev mailing list.