My Three Days at JavaOne 2012

After spending three days at JavaOne I’m happy to report that Java remains the most stable and reliable platform.There are some new additions to the language and the JVM that will make Java more complicated. I’m talking about Nashorn, Jigsaw, Lambda, and Modular Java. I’ve attended 10 presentations and participated in three hands-on labs. My notes are below.

JavaFX

JavaFX is a library and a tool set for creating rich UI for desktop and embedding UI into chips of various devices. It’s not meant to be used for creation of rich Internet applications. The user interface is defined in the .fxml files. It’s standard xml with some import statements.
The Scene Builder tool allows you to drag and drop UI controls and CSS onto the scene. It uses regular CSS3 so Java developers better start learning it. The processing logic is written in Java with some additional API. You can package JavaFX code into .exe and .dmg installers.
Each .fxml file has a corresponding controller Java class that lists handlers for the events and other code. It seems that development of the new features of JavaFX is going slow – addition of the ComboBox control is a modest achievement. Still, developers show interest to JavaFX and the session I’ve attended had about 200 people in the room.

Nashorn

This is a new JavaScript engine that will serve as a replacement of Rhino. You’ll be able to run JavaScript either from a command line or directly from your Java code. I’ve heard that the Nashorn engine is about 20 times faster than Rhino and is almost as fast as Google’s V8. Oracle gives Nashorn to Open JDK.

After looking at some code examples, I can assure you that the knowledge of JavaScript is a must. Nashorn allows you to create two types of the Molotov cocktail. A simple recipe for such cocktail is to write JavaScript on the left side of the equal sign and Java on the right. A more sophisticated recipe is to write JavaFX code and insert a block of JavaScript right in the middle without making any special warnings or annotations in the code. Some people can consume such cocktails, but the majority of today’s enterprise programmers will get hangover.

The Modular Java Platform

This project gives me goosebumps even though the goal is noble. For the last 17 years Java carried over the dead (a.k.a. deprecated) code from version to version. It gave stability and backward compatibility of the code. But the size of the JRE remained pretty big – 15Mb or so. Besides, your application may not even need all these jars that come with JRE. The modular Java Platform should simplify deployment to small devices, improve the download and startup time, eliminate the CLASSPATH (?!), and auto download and install on demand whatever modules are needed for your application. The project Jigsaw will become a reference implementation of the Modular Platform JSR.

The modular Java should solve the “JAR Hell” packaging problem. Instead of packaging JARS you should be able to group Java packages into modules and libraries. The new keywords will be introduced: module requires, provides, and more. The meaning of the keyword public will change. The public scope means “within the module” unless you export some classes to expose them to the external modules.

Modules could be packaged into libraries. The library dependencies are supposed to be resolved automatically (keeping my fingers crossed).

I realize that modularization of Java is extremely complicated task, and (the good news) it won’t be complete till Java 9. But Java developers may want to start sifting through the code of their applications to ensure that they use only the published API. But if you hacked JDK and used some internals, this code will break after deploying the modular Java platform in your organization. Consider looking for a new job unless you are searching for new challenges.

HTML5 Client and NetBeans

HTML5 is a buzzword for DHTML – HTML+JavaScript+CSS. Such front end in Web applications exchanges data with Java EE objects using JSON, and in the Java world you should be using JAX-RS and the Jersey framework. After attending several HTML5 presentations it seems that Java developers are eager to learn, but not overly familiar with this domain. NetBeans 7.3 comes with a project Easel that works with HTML5, and I’ve seen a demonstration of how to debug JavaScript inside NetBeans. I’m not exactly sure why is this needed since all modern browsers have their own debuggers, and recommendation to connect the IDE to the browser just for debugging purposes is questionable.

WebSockets – JSON – REST

I was glad to see how the right architecture of Web application was being promoted. Java servers should not be responsible for anything related to the UI in the Web browser. Java servlets, JSP or JSF should not mess with HTML at all. JavaScript on the front end consume JSON prepared by a REST service, which in Java EE world would be done by the JAX-RS rules. HTML and CSS are responsible for the UI layout. Several different sessions were preaching to this architecture. HTML5 includes the WebSockets API, which is a powerful alternative to the HTTP traffic. Next year’s release of Java EE 7 specification will publish a standard for processing JSON and using WebSockets in Java.

The final release of the JAX-RS Processing (JSR 353) is scheduled for April 2013. It’ll support the low-level Streaming API (similar to StAX’s XMLStreamReader) as well as high-level Object Model API. The streaming api will dispatch events: start streaming, key name, value, start array et al. Currently, the JSON-P’s JSonBuilder is too verbose, but allows programmers to control the way each piece of data is added to JSON. The future Jason-B (for binding) spec will offer a simple way of turning a Java object to a JSON string similar to what Google’s GSON library does. But the Jason-B spec won’t make it into Java EE 7 – use the version developed by EclipseLink.

A senior Java Developer attends an in-depth presentation on WebSockets by Justin Lee 

Labs

Imagine that you need to teach a hands-on class in the classroom with 100 attendees. Being an instructor myself I can assure you that it’s an extremely challenging task. I’ve attended three such labs. Each of the hundred laptops in the classroom had a pre-installed VM with the PDF describing the steps to be completed and supporting files. In such a setup the most important piece is well written document with instructions. Such manuals were great in two out of three classes I’ve attended, and I applaud these instructors. The third class was not prepared that well. The instructor simply said in the beginning, “This is a self-paced course. Just follow the instructions and let us know if you need any help”. Not even a 5-minute intro. Nothing. The first part required installing a number of software packages, and several installation instructions were simply missing. Attendees were helping each other explaining how they figured out what software was missing and the installation instructions were not provided. I left this class after playing catch for 20 minutes. Still, I’m grateful that Oracle offers such labs, which gave a jump start in learning new technologies to hundreds people.

Demo crashes

I’ve seen a fair amount of live demos that crashed. It happens, especially when you are presenting on a beta quality software. The audience usually takes these crashes with understanding – we all are sitting in the same boat. But I’d like to say that there are presenters and there are rock star presenters. I’d like to mention here a name of a really great presenter – James Ward from Heroku. I know James for years. This guy lives and breathes software. When he presents – everything usually works. If something breaks, James knows and explains why it broke and how to fix it. This time I’ve attended his excellent presentation about the Play 2 framework – give it a serious consideration if you’re in the process of picking a framework for your Web application. Besides being a great presenter, no one can beat James in the amount of the information James can produce per second. He’ll be presenting at the Java SIG in New York in October – be there if you’re in town.

Wasting time at JavaOne presentations

This time I’ve seen a new way of wasting time at the presentations. Conference attendees learned the hard way that promised presentation materials may remain promises. They help themselves by taking pictures of the presentation slides using mobile phones. But this time I’ve seen a guy who was taking photos with his iPad, and after taking a snapshot he’d immediately edit it using some application installed on the iPad. There is no way that he could concentrate on what the speaker had to say. Was he even a Java programmer or was sent to take pictures for his boss? The funniest part was that the entire slide deck of this presentation was already uploaded to the JavaOne’s site. My kudos to Oracle for trying to make the presentation materials quickly available to the public. Go to JavaOne 2012 Videos and select the menu Tools | Content Catalog. Lots of slide decks are already there, and in some cases you may even find the video recordings too.

Data Collections

I’ve attended a presentation on data collections. Believe it or not, but I’ve seen a person who knew the difference between dozens of Java collections. I’m not kidding. I’ve also learned that in addition to tons of JDK collections, there were a couple of more libraries: Guava collections by Google and collections developed by … Goldman Sachs. That’s right, the IT departments of this respected financial firm are known for creating proprietary general purpose frameworks and libraries.

Parties

Finally, my thanks to the GlassFish, Oracle Community leaders and third-party vendors who poured beer and whiskey into my glass – I’ve attended 6 parties in 3 days, where met a number of interesting people who love Java dearly. Those who attended JavaOne in the old days remember that was the private party by Tangosol was the most popular. I guess, this was the reason why Oracle acquired Tangosol five years ago. This year a vendor named ZeroTurnaround had a party, which can pick up where the Tangosol left off. The beer and wine are the same at each of these events, but this was an invitation-only party and many well known people were there. I had to take a red eye home, and gave away my ticket to a free concert by Perl Jam.

The Epilogue

It was a rather long blog – sorry for taking your time. Those who are not tired can go to http://www.oracle.com/us/corporate/press/1854982, where Oracle published the roadmaps for Java SE and JavaFX. Thank you Oracle for running JavaOne. I hope to come back next year. Thank you for keeping Java the most stable and reliable platform for professional application developers. Long live Java! See you in November in Antwerp, where I’ll be presenting on JavaScript for Java Developers at Devoxx.

One thought on “My Three Days at JavaOne 2012

Leave a comment