Tuesday Mar 11, 2014

Jfokus 2014 Trip Report

Jfokus 2014 took place 3-5 February in Stockholm, Sweden at the Waterfront Congress Centre. This was my first time at the conference. Jfokus slates itself as the largest developer conference in Sweden and it certainly is quite significant in terms of both content quality and attendance. Key organizer Mattias Karlsson deserves a well earned pat on the back for accomplishing such a feat in just a few years. Although the conference is most certainly not limited to Java, luckily for Java developers it does have a slight Java bend. The event attracted a bevy of World class speakers including quite a few of my fellow Oracle colleagues - Mark Reinhold, Georges Saab, Stephen Chin, Simon Ritter, Mark Heckler, Angela Caicedo, Geertjan Wielenga (NetBeans), Heather VanCura (JCP), Cecilia Borg (OpenJDK), Joel Borggrén-Franck (JDK) and Marcus Hirt (JDK). Notable other folks speaking included Venkat Subramaniam, David Blevins, Pratik Patel, Trisha Gee, Martijn Verburg and Anton Arhipov. Topics covered included Java SE, Java EE (of course :-), embedded Java, JavaScript, cloud, mobile, DevOps, agile and Big Data/NoSQL.

The conference started for me on Monday afternoon with a half-day university session titled "Down and Dirty with Java EE 7". This was really a demo-driven introduction to Java EE 7 using Cargo Tracker. Although the real point of Cargo Tracker is demonstrating some sound architectural practices for Java EE as a whole, we have actually wound up organically incorporating quite a bit of Java EE 7. As a result, I was able to use the project to provide an extended session with a mix of lecture and demos covering Java EE 7 at a fairly high level. The rather lengthy session was a full house and seemed to be fairly well received. The slides for the session are here (requires Silverlight - can download the slides even if not available). Ed Burns essentially did the same thing at DevNexus more recently (also using Cargo Tracker).

Tuesday is when the regular sessions started. It was sort of a lighthearted day for me since all I had was a dinner-time shootout between dynamic and static languages hosted by Stephen Chin. I showed up all pumped up with my arguments/counter-arguments ready to launch in favor of Java and static languages (big surprise I was chosen for the static team, right :-)?). As it turned out it was not a serious technical affair at all but just some game show style good matured antics. I had fun on stage and it was all cool. Later that evening I participated in a BoF on the JCP, OpenJDK, Adopt-a-JSR and Java EE 8 with Cecilia Borg, Heather VanCura and Martijn Verburg. I talked about some of the things we are considering on the Java EE 8 survey. The discussion was great and I got some good feedback to return back to the team.

I finished off the conference on Wednesday with my brand new talk titled "HTML5/Rich Clients Using Java EE 7" in the keynote hall. I am very glad Jfokus was keen on this talk since I have been waiting to deliver it for a while now (since then a bunch of other folks have also expressed interest in the talk already). The talk is about the excellent alignment Java EE has with the emerging world of HTML5/JavaScript frameworks like AngularJS, Backbone, Knockout and Ember. Java EE is really quite well positioned to adapt to richer browser clients with APIs like JAX-RS, WebSocket, JSON-P, CDI, EJB3, JPA and Bean Validation. I also briefly talked about Oracle's project Avatar. The talk was a full house and was very well received.

The slides for the talk are below, the demo code is on GitHub. The project should be very easy to setup, but do give me a shout if you need help. My intent is to give you the very basics of what you need to get started exploring this type of architecture.

It was good to catch up with a bunch of folks all at this one event. Check out the pictures below with me, David, Amelia, Tori, Steve, Thomas, Mark and Simon hanging out in the hotel lounge after the conference!

While in Stockholm, a few of us had occasion to check out a few cool spots like old town, the Royal Palace, the Vasa Museum and Skansen (thanks in large part to the pre-conference speakers-only tour organized by Mattias).

The Vasa Museum and Skansen I thought were particularity cool. The Vasa was a massive wooden warship launched in 1628. Legend has it the pride of the Swedish King tragicomicaly sank within minutes of being launched condemning most of the crew to a frigid death due to a number of critical design flaws that rooted back to the King's overgrown ego. The ship was dredged up from the icy waters in the twentieth century, restored and placed into one of Sweden's most visited museums. Skansen has a decidedly less dubious past - reportedly one of the oldest open air museums in the world, it is intended to be a miniature model of Sweden itself in the pre-Industrial era. With aging but well-kept structures moved piece-by-piece from various parts of Sweden and reconstructed in Skansen as well as reenactors in period costume Skansen really feels like going back in a time machine. In US terms, it felt sort of like a very serious and realistic Renaissance Fair (check out the photo album below).

All in all, this was a very good trip. I look forward to going back to Stockholm and Jfokus another year...

Thursday Oct 17, 2013

How You Helped Shape Java EE 7...

I have been working with the JCP in various roles since EJB 3/Java EE 5 (much of it on my own time), eventually culminating in my decision to accept my current role at Oracle (despite it's inevitable set of unique challenges, a role I find by and large positive and fulfilling). During these years, it has always been clear to me that pretty much everyone in the JCP genuinely cares about openness, feedback and developer participation. Perhaps the most visible sign to date of this high regard for grassroots level input is a survey on Java EE 7 gathered a few months ago. The survey was designed to get open feedback on a number of critical issues central to the Java EE 7 umbrella specification including what APIs to include in the standard. When we started the survey, I don't think anyone was certain what the level of participation from developers would really be. I also think everyone was pleasantly surprised that a large number of developers (around 1100) took the time out to vote on these very important issues that could impact their own professional life. And it wasn't just a matter of the quantity of responses. I was particularly impressed with the quality of the comments made through the survey (some of which I'll try to do justice to below).

With Java EE 7 under our belt and the horizons for Java EE 8 emerging, this is a good time to thank everyone that took the survey once again for their thoughts and let you know what the impact of your voice actually was. As an aside, you may be happy to know that we are working hard behind the scenes to try to put together a similar survey to help kick off the agenda for Java EE 8 (although this is by no means certain). I'll break things down by the questions asked in the survey, the responses and the resulting change in the specification.

APIs to Add to Java EE 7 Full/Web Profile

The first question in the survey asked which of four new candidate APIs (WebSocket, JSON-P, JBatch and JCache) should be added to the Java EE 7 Full and Web profile respectively.

Developers by and large wanted all the new APIs added to the full platform. The comments expressed particularly strong support for WebSocket and JCache. Others expressed dissatisfaction over the lack of a JSON binding (as opposed to JSON processing) API.

WebSocket, JSON-P and JBatch are now part of Java EE 7. In addition, the long-awaited Java EE Concurrency Utilities API was also included in the Full Profile. Unfortunately, JCache was not finalized in time for Java EE 7 and the decision was made not to hold up the Java EE release any longer. JCache continues to move forward strongly and will very likely be included in Java EE 8 (it will be available much sooner than Java EE 8 to boot). An emergent standard for JSON-B is also a strong possibility for Java EE 8.

When it came to the Web Profile, developers were supportive of adding WebSocket and JSON-P, but not JBatch and JCache. Both WebSocket and JSON-P are now part of the Web Profile, now also including the already popular JAX-RS API.

Enabling CDI by Default

The second question asked whether CDI should be enabled in Java EE by default.

The overwhelming majority of developers supported the default enablement of CDI. In addition, developers expressed a desire for better CDI/Java EE alignment (with regards to EJB and JSF in particular). Some developers expressed legitimate concerns over the performance implications of enabling CDI globally as well as the potential conflict with other JSR 330 implementations like Spring and Guice.

CDI is enabled by default in Java EE 7. Respecting the legitimate concerns, CDI 1.1 was very careful to add additional controls around component scanning. While a lot of work was done in Java EE 6 and Java EE 7 around CDI alignment, further alignment is under serious consideration for Java EE 8.

Consistent Usage of @Inject

The third question was around using CDI/JSR 330 @Inject consistently vs. allowing JSRs to create their own injection annotations (e.g. @BatchContext).

A majority of developers wanted consistent usage of @Inject. The comments again reflected a strong desire for CDI/Java EE alignment.

A lot of emphasis in Java EE 7 was put into using @Inject consistently. For example, the JBatch specification is focused on using @Inject wherever possible. JAX-RS remains an exception with it's existing custom injection annotations. However, the JAX-RS specification leads understand the importance of eventual convergence, hopefully in Java EE 8.

Expanding the Use of @Stereotype

The fourth question was about expanding CDI @Stereotype to cover annotations across Java EE beyond just CDI.

A solid majority of developers supported the idea of making @Stereotype more universal in Java EE. The comments maintained the general theme of strong support for CDI/Java EE alignment

Unfortunately, there was not enough time and resources in Java EE 7 to implement this fairly pervasive feature. However, it remains a serious consideration for Java EE 8.

Expanding Interceptor Use

The final set of questions was about expanding interceptors further across Java EE.

Developers strongly supported the concept. Along with injection, interceptors are now supported across all Java EE 7 components including Servlets, Filters, Listeners, JAX-WS endpoints, JAX-RS resources, WebSocket endpoints and so on.

I hope you are encouraged by how your input to the survey helped shape Java EE 7 and continues to shape Java EE 8. Participating in these sorts of surveys is of course just one way of contributing to Java EE. Another great way to stay involved is the Adopt-A-JSR Program. A large number of developers are already participating through their local JUGs. You could of course become a Java EE JSR expert group member or observer. You should stay tuned to The Aquarium for the progress of Java EE 8 JSRs if that's something you want to look into...


Reza Rahman is a former independent consultant, now Java EE/GlassFish evangelist.

He is the author of the popular book EJB 3 in Action. Reza is a frequent speaker at Java User Groups and conferences worldwide.

Reza has been a member of the Java EE, EJB and JMS expert groups. He implemented the EJB container for the Resin open source Java EE application server.

All views voiced are my own, not necessarily Oracle's.


« April 2014