Skip to main content

Java One 2009 Day 4

Posted by cayhorstmann on June 5, 2009 at 9:03 PM PDT

The Toy Show

One of my favorite parts of Java One is the Friday morning “toy show” where James Gosling presents a random mixture of cool and inspirational projects. Of course, all these involve Java in some way.

The BlueJ team received a well-deserved special recognition for building tools that help millions of high school and college students get started with Java.

water-troll.png

A fellow from RuneScape dev demoed their tools, and I learned how one animates a water troll, something that will surely come in handy one day.

There was a wacky demo involving a Wii infrared sensor and infrared LEDs that guide a projector. One of them lets kids draw on a virtual wall. I want it for the Horstmann twins.

Tor Norbye, the demo stud, showed a very impressive JavaFX authoring tool whose release is planned in December. I admit that I was dubious about Java FX when it was first released, but it is looking much better now. At least when Tor demoes it...

There was a demo by the high school kids who won the FIRST robotics contest. Sun and the FIRST folks just ported the programming environment from C/C++ to Java. They hope it will lead to more interesting robots in the future—right now, the students struggle enormously with core dumps. They need volunteers—check out their web site. What's in it for you? “There is nothing more fun than see your program drive on the floor.”

gosling-14.png

The Grameen foundation showed off an open source system for helping with microfinance in third world countries. They also need volunteers.

SIM cards have now become so powerful that they can easily run Java and a web server. The latest ones can interact with sensors and WiFi radios. A fellow showed how you can mock that up with Sun Spots for easier debugging.

gosling-14.png

Someone demoed a satellite ground station management app built on Netbeans RCP (i.e., the same platform on which the Netbeans IDE was built), using over 1000 modules. As it happened, James Gosling's first programming job was in a satellite ground station (he was 14), using a PDP 8. It had less compute power than a modern smart card.

Two Hungarian university students showed off the project that won them first price in the Ricoh printer contest. Those printer/copiers are Java-powered, and the students used them to grade multiple choice exams.

A musician showed off a Java-powered juke box that allows independent artists to upload their creations to a web site and have it played in bars. As James put it: “Here's Manuel. He is a musician. He has a problem.”And with the help of a touch screen, a cash reader, and Java FX, he put together a solution.

“Project Bixby” controls an Audi TT on a dirt rallye course going really fast (160 km/h) without a driver. And finally, the“LincVolt” project controls a 1959 Lincoln Continental with an electric motor, this time with a human driver—another musician named Neil Young. There is a Swing-based control panel. Boy, is it ugly—maybe JavaFX can help. What's next? The “Thinkin' Lincoln” that no longer requires Mr. Young?

Technical Sessions

I attended the “JPA Magical Mystery Tour” session. JPA has been a real game-changer, maybe more than people realize. I can now routinely run student projects that involve a database, with a lecture on JPA and a couple ofcode samples. These are greenfield projects, so there is no need for any SQL. Of course, as the speaker pointed out, in a real project, you don't need to write the SQL, but you still need to understand what goes on. For example, JPA 2.0 has a nifty @OrderColumn for persisting list orderings, but you really need to think about the implementation to understand the costs. The talk started out with the basic mappings and it got a bit mysterious at the end, with attribute overrides and compound primary keys, but it never quite rose to being magical. I had hoped for more details about the magic of the entity manager. Moral: Don't overpromise in your title.

Bill Pugh gave a repeat of his “Defective Java” talk—the antidote to “Effective Java”. If you haven't used his FindBugs tool, check it out now! He had a sabbatical at Google where he explored how FindBugs does on production code. Interestingly, it found a lot of bugs—over 3/4 of the flagged issues were deemed by Google engineers to be mistakes that should be fixed—but it didn't find many mistakes that really matter. Those had been found earlier, and perhaps painfully, through testing and failures in production. The moral is to use FindBugs early. Bill is now working on a cloud service for community review, where programmers can post previously found bugs. When you evaluate a FindBugs issue, you can then evaluate whether it is likely to be serious.

Our cat, Mr. Darcy, would like to thank Bill for the bug that he tossed my way when I raised my hands as soon as I saw the slide involvingDouble and ==.

Ludovic Champenois (AKA Ludo) gave a presentation about EE6 tooling in NetBeans and Eclipse—sadly not well-attended at a time slot that is usually reserved for such crowd pleasers as “Enhancing the Role of aLarge U.S. Federal Agency as an Intermediary in the Federal Supply Chain via a Service Registry and a JBI-Based ESB”. Ludo is responsible for the Glassfish plugin for Eclipse, which I can heartily recommend. If you just get started with it, download the Eclipse/Glassfishbundle. You get one-stop shopping, just like with NetBeans, with JavaDB configured, all XML schemas, javadocs, etc.

Finally, after having been thoroughly worried about JSR 299 vs. JSR 330, I decided I'd better learn more about Guice, and I attended the talk by Jesse Wilson. Ok, it's a nice enough DI framework. You configure injection with a “fluent” API, not XML. That's nice. But it isn't as nice as WebBeans, erm, Contexts and Dependency Injection. Instead of writing a lot of XML boilerplate for configuring a test of a large system, Guice makes you write a lot of Java boilerplate.

Here is the one thing I don't get about JSR 330. It has this annotation @Inject that tells you that you want to inject something,but it doesn't tell you why. Injection annotations such as @Resource, @EJB, @PersistenceContext, @ManagedProperty, are common in Java EE. I can see the benefit of having a meta-annotation that says “this annotation injects”, but I don't see why you would want a single injection annotation. I asked Jesse about that, and he seemed to say that injection was this big, scary, strange thing that should definitely stare in your face in your source code. Well, in my Java EE experience, injection is your friend, not something that you fret about. So it seems that in its current form JSR 330 isn't very compatible with, say, JP Ain a Java SE application, surely a reasonable use case. My suggestion would be for JSR 330 to lighten up, realize that there isn't going to be a single source of injection, and focus on meta-annotations and commonalities among injection providers. Caveat: I am not an expert on this stuff, just someone who looks at it from the outside with some experience in both EE and SE.

Summary

Java One is now over, and here are my random conclusions and opinions.

  • Concurrency is on many developers' minds, and there is no silver bullet.
  • The evolution of the Java language is essentially over. There may be a few minor tweaks on the way, but if you are pining for closures, properties, or metaclasses, look elsewhere. Scala is a great choice today, and Groovy could be good if they'd just start writing a language spec.
  • I am still a bit sore that Java FX is yet another language and not a DSL in Scala or Groovy, but the libraries and tooling have come a long way. I'll give it another try. And, hey, Larry Ellison (or perhaps his personal coder) likes it.
  • Java EE 6 is a winner. With sane WAR packaging, JSF 2.0, JPA 2.0, and (hopefully) web beans, erm, contexts and dependency injection, it can truly stand on its own without third party components (ok, except for a library of decent-looking JSF components).
  • A trend started a few years ago where more presenters and conference attendees used Mac OS X, Linux, or even the occasional OpenSolaris. These screens easily make the majority now. There is a sea of Macs, and even the orange glow of Ubuntu easily outnumbers Vista.
  • Where will Java go after the Oracle acquisition? Will there be another Java One? Will the JCP stay on? My guess is that Oracle will not make any major changes in the near future, and that we will all meet again for Java One 2010 next year.

Comments

Thanks Cay, always a pleasure to read your blogs. -kto

What made you come to the conclusion that the evolution of the Java language is over? Why? Are there just too many cooks in the kitchen and no one can decide on what should be added? I don't understand this at all. I think it's ridiculus that .NET and C# is getting so many cool new features and Java just remains the same year after year.

I like Clojure a lot. If you want a Lisp dialect for the JVM, it is a great choice. Personally, I think Scala is a bit easier for most Java refugees who don't have a Lisp background, so I think that will benefit it. Of course, what will really benefit either or both is a "killer app", like Rails is for Ruby.

Professor Horstmann, What do you think of Clojure (STM) over Scala for future? I am kind of dislike Scala syntax while Clojure LISP code looks nice. Thanks.

jemiller1: For some time, I had some expectation that Java 7 or at least Java 8 would evolve at a rate that is commensurate with, say C#. But I no longer believe that is going to happen. I don't think there are too many cooks, it is just that the cooks have different tastes. They are not so interested in new features, and they are very concerned with backward compatibility and accidental complexity. I am not saying that is good or bad--my private opinion hardly matters--but that it is something to keep in mind when you plan ahead. Personally, I am looking much more at Scala when I want to have fun and be more productive, while keeping compatibility with Java.