Sunday, September 30, 2012

JavaOne 2012: JavaOne Technical Keynote

Mark Reinhold started off the JavaOne 2012 Technical Keynote. He said this year's edition would be a little different because it would use largely the same example to illustrate various aspects of Java rather than standalone individual coverage of each component of Java. Richard Bair and Jasper Potts of the JavaFX team (and associated with FXExperience) introduced this example application, a schedule builder with presentation and speaker data from this year's JavaOne.

As part of the introduction of the example application, the presenters made extra effort to point out that Oracle is shipping the JVM for MacOS and that OpenJDK is what is being used in the example. They also stated that the example runs on Linux as well. They used Java SE 7 and JavaFX 2 for this application and they talked about the availability of SceneBuilder for building a JavaFX application. They demonstrated the use of SceneBuilder within NetBeans to generate the JavaFX-based login page.

Other interesting JavaFX advancements mentioned include the addition of a ComboBox (though there is no Date Picker yet), interoperability with SWT, and the availability of a JavaFX Packager. It was also mentioned that JavaFX was architected and designed from the beginning to allow for the main UI thread to be separate from background threads, allowing it to take advantage of multiple CPUs.

Bair showed the relatively verbose code that would be required to implement a JavaFX application to fully take advantage of multiple threads today. Brian Goetz came to the stage to describe how Project Lambda and the changes to the Java language will enable "better parallel libraries." Goetz said that the easiest way to help developers is to give them better libraries, but the language must sometime be extended when the limits of the language prevent libraries from being written to fully satisfy the need.

Goetz stated that the goals of inner classes are the same as Project Lambda, but inner classes have "a whole lot of other baggage." Goetz added that bulk operations on collections may not "really be needed, but things are better this way." Goetz then showed a simple but highly illustrative example of how Project Lambda changes how we process bulk data changes in a collection. His slide showed the J2SE 5 enhanced for loop is used today but can be done with the forEach method (added to all of the collections via the new default implementation interface approach) and a Groovy-like closure syntax (->).

Goetz's next slide was even more impressive. He showed what appeared to be three operations being performed on a collection as it was iterated. However, he pointed out that these would all be enacted at once on the collection with only a single traversal of that collection. All I could think was, "Wow!" Goetz also had a slide showing off the computeIfAbsent operation on collections. He ended by saying there's still lots of work to do and citing two URLs for playing with Project Lambda: and

There was some interesting discussion on the differences between traditional Java environments and embedded environments. Raspberry Pi received multiple and prominent mentions.

Reinhold started talking about modularity and Project Jigsaw and showed a "little bit of a spaghetti diagram that is way cleaner than where we started, which was a total spaghetti diagram." He used this as a starting point for discussing the controversial decision to boot Project Jigsaw from Java 8 to Java 9.

Reinhold had a slide focused on things that are in Java 8 such as Project Lambda, Compact Profiles, Type Annotations, Project Nashorn, and the new Date/Time API. Reinhold added that "all this work is being done in OpenJDK" and that "all the specification work is being done in the JCP."

Arun Gupta had the unenviable task of beginning his presentation at the time the keynote was scheduled to end (7 pm local time). He talked about Java EE and showed a slide titled, "Java EE Past, Present, & Future." This slide showed how Java EE has added features since the ten specifications of J2EE 1.2 in December 1999. Gupta had another slide talking about "Java EE 7 Revised Scope" and how it increases productivity (via less boilerplate code with richer functionality and more defaults) and adds HTML5 support (WebSocket, JSON, and HTML5 Forms).

Another Gupta slide was titled "Java EE 7 - Candidate JSRs" that listed JSRs that are all new to Java EE 7 as well as those being modified. He then focused individual slides on some of them. His "Java API for RESTful Web Services 2.0" slide talked about a standarized approach using a client API. Gupta's slides showing how this is done today (without libraries) and comparing it to the next client API demonstrated how much simpler this is going to be.

Gupta's coverage of JMS 2.0 included discussion of less verbosity in JMS thanks to annotations and other new features in the Java programming language. He mentioned that the required resource adapter will make it easier to "mix and match" JMS providers in the future. Gupta showed a slide full of small-font code ("this code is not meant to be readable") demonstrating sending a message using JMS 1.1. This was followed with a slide showing significantly less (and much clearer) code in JMS 2.0 taking advantage of annotations and resource injection to send a message.

Gupta's coverage of the JSON support to be added to Java EE included the bullet "API to parse, generate, transform, query, etc. JSON." He then showed some slides with example JSON-formatted data and example code for using builder-style to access the JSON. It felt a lot like Groovy's JSON handling.

Java API for WebSocket 1.0 will allow annotations to be used to easily work with WebSocket. When covering Bean Validation 1.1, Gupta pointed out that not all new adopted JSRs are being led by Oracle. He showed using the built-in @NotNull annotation on method parameters, but also showed that one will be able to write custom constraints that can be similarly applied to method arguments.

Gupta highlighted miscellaneous improvements to Java EE such as JPA 2.1, EJB 3.2, etc. The majority of these JSRs have early public drafts available. GlassFish 4 is the reference implementation of Java EE 7 and already includes WebSocket, JSON, JMS 2, and more.

One of Gupta's slides was focused on Avatar. The "Angry Bids" example application was demonstrated. It is based on Avatar and runs on GlassFish and uses standard Java EE 7 components.

Gupta introduced Project Easel for NetBeans. It was mentioned that NetBeans 7.3 beta would be coming out later this week and will include support for HTML5 as a new project type. The example being showed uses JQuery and CSS. The NetBeans-based example communicated through Google Chrome to WebKit (it also works with the JavaFX-embedded browser), but it is expected to work eventually with any WebKit-based browser or device. The demonstrator showed how his changes to HTML5 code (HTML, JavaScript, and CSS) within NetBeans were updated in the Google Chrome browser. It was pretty impressive and makes me wish I had enough time to have accepted an invitation to provide early testing of NetBeans 7.3. NetBeans is going to be able to generate RESTful clients, support JQuery, and provide a Project Nashorn editor. A similar demo to this one is available at

Like the Strategy Keynote, this Technical Keynote was held in the Masonic Auditorium. One of the interesting trends I noticed in tonight's keynotes was that at least three different people from three different organizations mentioned looking for skilled Java developers should contact them if interested in job opportunities.

JavaOne 2012: Java Strategy Keynote and IBM Keynote

I had a rough start to JavaOne 2012 similar to that at JavaOne 2010. It took 70 minutes for the people handling the check-in to provide me with a JavaOne badge due to "computer and printer technical difficulties." Although I'm not the most patient person in the world, the part of this that was even more disappointing than the wait is that I missed being part of the "Community Session: For You - By You: Growing the NetBeans Community" panel at NetBeans Community Day at JavaOne 2012, something I was really looking forward to attending and participating in. I had arrived at Moscone West about 15 minutes before that panel was to begin, but did not end up getting my badge until well after the panel was over. In a disappointed mood, I headed to the Nob Hill Masonic Center (AKA Masonic Auditorium, AKA California Masonic Memorial Temple) on Nob Hill to attend the initial evening's keynote address.

Java Strategy Keynote

The first announcement was to "turn off all electronic devices." After that announcement, a video was shown. I was happy that it was short. Hassan Risvi introduced the theme for JavaOne 2012: "Make the Future Java." He showed slides indicating the 2012 Scorecard for three areas of Java's strategy: technical innovation, community involvement, and Oracle leadership.

Georges Saab stated that Oracle has made Java available for more new platforms in the past year with JDK 7 than added in the previous ten years. He highlighted JDK 7's adoption and talked about OpenJDK. One feature of JDK 8 that he highlighted is Project Nashorn, a JavaScript implementation taking advantage of invokedynamic for high performance with high interoperability with Java and the JVM. He announced that Project Nashorn will be contributed to OpenJDK. He stated that IBM, RedHat, and Twitter have already expressed support for Project Nashorn as part of OpenJDK.

Dierk K├Ânig of Canoo and Navis were guest speakers at this Strategy Keynote. They talked about their use of JavaFX and the Canoo Dolphin project being open sourced.

Nandini Ramani talked about JavaFX and stated that its now available for all major platforms. She also cited the release of NetBeans 7.2 with integrated SceneBuilder as part of improved tooling. She also reminded the audience that JavaFX is now bundled with current versions of Java. Ramani announced that JavaFX is now available for Linux ARM. She mentioned that 3D is coming to JavaFX. It was also mentioned in this keynote that they expect JavaFX to be fully open source by the end of the calendar year.

AMD's Phil Rogers talked about hardware trends moving from single-core CPUs to multi-core CPUs to GPUs using "a single piece of silicon and shared memory." Saab and Rogers stated that Project Sumatra allows the JVM to be modified so that Java developers can take advantage of new features in the hardware with existing Java language skills. The JVM will be able to decide whether to run the Java code on a multi-CPU or multi-processor.

Ramani returned to the stage and mentioned two new recently announced releases: Java ME Embedded 3.2 and Java Embedded Suite 7.0. Axel Hansmann of Cinterion talked about his company's use of Java ME Embedded.

Marc Brule of the Royal Canadian Mint joined Ramani on stage to talk about their use of Java Card: MintChip ("The Evolution of Currency").

Cameron Purdy came to the stage to discuss Java EE. Purdy announced that the earliest releases of Java EE 7 SDK can be downloaded via GlassFish versions. Purdy also announced that GlassFish 4 already includes significant HTML 5 additions mentioned at JavaOne 2011. Purdy pointed out that NoSQL is not standardized yet ("you could call it 'No Standard Databases'") and pointed out that JPA already supports MongoDB and Oracle NoSQL with planned support for Cassandra and other NoSQL implementations. Purdy stated that April 2013 is the currently planned timeframe for release of Java EE 7.

Nicole Otto of Nike joined Purdy on stage and showed a brief video (FuelBand: "Life is a Sport: Make It Count"). She talked about Java EE being used to track data on activity. Purdy had a slide "Java EE 8 and beyond" that was sub-titled: "Standards-based cloud programming model."

A short film was shown to introduce Dr. Robert Ballard (now I know why we were given the Alien Deep DVD upon entrance to the keynote). Dr. Ballard talked about his discovery of the Titanic and explained how the technology used for that discovery was like tying two tin cans together compared to the technology available today. The most laughter and applause of the night came to his statement that he hoped to find a spaceship in his explorations so that he never has to talk about discovering the Titanic again. Dr. Ballard stated that we should not sell science or engineering but should make it more personal to kids and sell scientists and engineers. He stated that "the battle for a scientist of engineer is over by the eighth grade."

IBM Keynote: (hardware,software)–>{}

We moved, without break, directly into the IBM Keynote. Jason McGee (blog), an IBM representative, talked about "some of the things we've seen related to Java and the cloud." He talked about "Java Challenges" as "share more," "cooperate," "use less" (resources), exploit technology. John Duimovich came to the stage to talk more about these four challenges "in context on the Java Virtual Machine."

Duimovich talked about "shared classes cache" and AOT (Ahead of Time), described as "JIT code saved for next JVM" to use. Duimovich also talked about multi-tenancy and supporting "isolation within a single JVM." He had a slide on the Liberty Profile "for Web, OSGi, and Mobile Apps."

Duimovich introduced "really cool hardware" called System z and explained the advantages of running Java (rather than C or C++) on this hardware. Duimovich stated that "Oracle and Java team together on Java, but compete head to head." He pointed out that this "competition drives innovation" and is good for customers and developers.

McGee returned to the stage to talk about a few more themes, observations, and trends. He pointed out that "Java provides developers abstraction from underlying hardware," but that "hardware is changing and evolving rapidly." McGee's slide stated that "both Java and Cloud need to enable the exploitation of these hardware advances while still preserving the 'run anywhere' benefit."

Another McGee slide was titled "Java in a ploygot world..." and he used this slide to talk about the world transitioning from an all-Java enterprise world to today with applications written in numerous languages. He mentioned several alternative JVM-based languages and put a plug in for IBM's X10 language. McGee believes that Java will be part of, but not all of, future enterprise applications.

Tuesday, September 18, 2012

Packt Publishing's 1000th Title: Surprise Gifts

Packt Publishing published its first book in 2004 and is about to publish its 1000th book. Along the way, Packt Publishing has donated a portion of revenue to the open source projects covered by its books. As part of their celebration of publishing their 1000th title, Packt Publishing has a "surprise gift" for anyone who has registered with them or has an account with them on 30 September 2012.

This is the information Packt Publishing provided to me related to this celebration:

To celebrate this event with our readers, we'd be gifting them with not one but two assured surprises which would be revealed to them by the 30th of September, 2012. Anyone who is already registered or signs up for a free Packt account before 30th September 2012 is guaranteed a surprise gift.

I have received electronic copies of Packt Publishing books in the past as part of book reviews. The books I reviewed are JBoss AS 7 Configuration, Deployment and Administration, Java EE 6 Cookbook for Securing, Tuning, and Extending Enterprise Applications, and Java EE 6 Development with NetBeans 7. In addition, I have purchased three electronic books from Packt Publishing (Groovy for Domain-Specific Languages, Learning jQuery, and Java 7 New Features Cookbook).

Packt Publishing has offered me an electronic book for promoting this celebration event and I am having a difficult time choosing from many selections that look interesting including Grails 1.1 Web Application Development, GlassFish Security, Java 7 Concurrency Cookbook, Akka Essentials, and Java EE 6 with GlassFish 3 Application Server.