15 November 2012

JavaEE.Next : Java 7, 8 & Beyond

by Reza Rahman

"Things that we in Oracle see"

Sparing us from the unnecessary historical overview we can actually jump in the features, that are under discussion for the next Java 7 release (JSR-342). By the way the discussion was very broad, also including technologies and improvements that are going to be released in the 8th version and beyond (as you might already know the Java EE7 is planned for April 2013).

The JMS 2 API for example would be modernized, including dependency injection and some API refactoring. Other changes to the API include:

  • any implementation of the API would also need to implement the JCA adapter
  • changes related to asynchronous sending of messages, delay settings, etc.
  • some changes to the code display - visually fewer lines of code, by injecting the whole JMS context and removing the boilerplate code for creating messages
  • JMS resource definition - a very quick and easy way to define a resource using annotations

There would also be a Java API for WebSockets that uses declarative style for creating WebSockets. Did you know what WebSockers are? Me neither ... but apperantly they are very important for online gaming and full duplex communication over the TCP protocol.

The Java API for JSON processes would put some smiles on the faces of people who actually like tinkering with JavaScript (There are such people, aren't there? Because I've heard of them but never saw one). The API would allow for parsing, generating and transforming JSON queries, taking in mind the best practices that are established. The API would also allow two models of usage - model and streaming - similar to the DOM & STAX APIs. However, as good as that might sound, binding JSON to Java objects is not planned for Java EE7 and would perhaps be there in Java EE8

"The big new thing" in JAX RS 2 will be the client API, but there would be other enhancements too such as (but not limited to) : filtering, interceptors, hypermedia support, etc. As part of the presentation there was a very good example of building up a client, but unfortunately I was not able to find this example. It was pretty impressive though.

Another big new thing (that would hopefully be part of Java EE7) was the Java Temporary Caching API (see JSR-107). It would be highly configurable by using annotations - e.g. defining a cache eviction strategy in a declarative fashion.

The same as last year there was some talk about JPA 2. There are some neat new features such as

  • Schema generation - the persistence manager generating the schema based on the JPA mappings, which was already feature of some of the implementations of JPA, but now the standard would define it.
  • There would also be support for stored procedures! Yes, we all have some bad memories from working with stored procedures, but they are there and we can't ignore them.
  • The persistence context would not be auto-flushed and thus we would be able to define the policy in the persistence manager
  • Last, but certainly not least, there would be a way to define entity conversion strategies, e.g. converting database types to Java types

The JTA 1.2 API would also be present in the release, another old API that needed actualization. It would now have declarative transactions outside the EJB and would also allow for the definition of transaction scope.

My favorite bittersweet API - the JSF 2.2 API - would also be improved:

  • HTML5 support! Yes, yes, the new big thing ... yet another new big thing
  • @FlowScoped vs @ViewScoped for CDI (stands for "Contexts and Dependency Injection" if you did not know, see JSR-299) - basically define your own regions in the whole web application and thus identify which objects need to be destroyed while navigating through the regions.
  • Finally! A FileUpload component would be defined by the API and the framework implementations would confirm to a single API, unlike the various custom implementations that are currently used.
  • View actions and multitemplating
  • Speaking of HTML5 - there is the option to use the native components and still bind them (using the framework IDs) with the rest of the application, effectively integrating them in the framework
For more information you can check this article on what's new in JSF 2.2

There was also a lot of talks about some interesting candidate APIs that might or might not make it in the next release, such as

  • API for robust batch processing (JSR 352? not sure ...) specifically designed for the EE platform and would allow for defining components via annotations, etc.
  • Bean validation
  • Servlet 3.1 - non blocking I/O, Web sockets again, etc.
  • CDI 1.1 - Servlet events, ordering of interceptors, etc.
  • EL 3.0, EJB 3.2, etc.

What about Java EE8? It would come 2 years after Java EE7 (if I am correct this would be April 2015) and would bring us to the cloud - PAAS, multitenancy, IAAS - but would also provide updates on HTML5, bring more modularity, etc.

14 November 2012

Java2Days 2012

After a prolonged and inexcusable pause I am back, sharing my impressions from this year's Java2Days conference which took place a few days ago at the InterExpo Center in Sofia.

As a whole the conference was somewhat disappointing because there was too much repetition from last years topics (and lectures) and not enough thrilling new stuff, which I believe this conference is all about :)

However I did manage to make some notes and will share some of the most interesting topics. Here is a preliminary list of all of the articles I'd like to cover:
  • JavaEE.Next : Java 7,8 & Beyond another very good inside preview by Reza Rahman
  • Multi Client Development with Spring MVC by Josh long
  • API Design a very interesting topic presented by Pavel Penchev
  • HTML5 where Andrew Lombardi synced us up on the HTML5 adoption
  • Garbage Collection & Memory Leak Detection where my friend Simeon Iliev
  • shared some experience with the JVM memory management
  • Testing Multithreaded Java Applications for Synchronization Problems - a very serious and advanced lecture by my colleague Vassil Popovski
  • Dependency Injection in OSGi by Jerome Moliere
  • Domain Driven Design with Java EE 6 another very interesting lecture by Reza Rahman
  • and finally some words on Taming NoSQL with Spring Data which is a very good overview by Sergi Almar Graupera on how Spring integrates with most popular of the currently available NoSQL database engines

The Java2Days participants have provided some of the presentations here.