sebastiandaschner blog


Thoughts on Java EE 8

#javaee saturday, march 19, 2016

As the Java EE 8 specs are currently being developed there is still room for potential ideas to be integrated into specifications.

This weekend Mark Struberg, Reinhard Sandtner and myself brainstormed about some potential improvements in the Java EE specification.

As explained in one of my previous blog posts one of the biggest advantages of Java EE is the ability to seamlessly integrate and (re-)use several components within the umbrella. In order to achieve this I’ve previously proposed a broader DI integration in both JSONB and JAX-RS.

An even more comprehensive approach for dependency injection support within Java EE could be to require in several JSRs that JSR 330 annotations should be supported as soon as any JSR 330 capable DI framework (like CDI) is available.

Examples:

  • Bean Validation’s ConstraintValidators are able to @Inject CDI managed beans

  • JAX-RS' UriInfo could be made available as (request scoped) bean by supporting @Inject

  • JAX-RS' @QueryParams could be made available as (request scoped) beans as well (by using qualifiers and producer methods)

The point is that the JSRs are then not only more loosely coupled by relying on JSR 330’s annotations — and still requiring CDI as a first class Java EE citizen — but also other technology could be integrated more easily by registering producer methods and SPI-like functionality. The specifications could be written in a way like “if the implementation contains any JSR 330 supported functionality it has to include managed beans and make following components available with following qualifier annotations: …​”.

What do you think? Feedback is highly welcome.

 

Found the post useful? Subscribe to my newsletter for more free content, tips and tricks on IT & Java: