Java One Day 0

Today is day 0 of Java One, AKA “Community One,” with a focus on open source and community projects. With the economy being what it is, and Java One stretching the definition of “early bird” specials past the breaking point—the discount was good until today—I was fearing for the worst, but there definitely were crowds today.

Here are some of my impressions from today.

Guillaume Laforge gave a nice presentation on what is new in Groovy 1.6. An expanded version of the talk is here. I was most impressed by the ability to manipulate abstract syntax trees. For example,

class Event {
    @Delegate Calendar when
    String title, url
}

All of Calendar's methods are added to Event and delegate to the when object. In Java, this would be an absolute no-no. Annotations are not supposed to change the classes that are being annotated. But Groovy isn't Java, and in a more dynamic world, these transformations make perfect sense.

I really want to like Groovy, but what is holding me back is (a) the rather ad-hoc process in which Groovy rediscovers what has been known in other (mostly functional) languages for a long time and (b) the stubborn resistance to producing a language spec.

As for (a), consider the sections on ”multiple assignment” and “optional return for if/else and try/catch/finally blocks” in the InfoQ article. In Groovy, you can now write

def (a, b) = [1, 2]

What's with that mishmash of parentheses and brackets? In Scala, you'd write

val (a, b) = (1, 2)

That's because Scala—like so many of its predecessors—has tuples. And Scala—like so many of its predecessors—has conditional expressions that return values, without having to wait for version 1.6.

Perhaps I quibble. But the lack of a spec really bothers me. Suppose I add two @Delegate fields to a class. What happens if one method signature is shared by both delegates? I asked about the spec, and Guillaume's response was that a spec was not really needed. The Groovy API documentation is excellent, and there is an extensive set of test cases. (Note to self—check that out.) Well, the API documentation for @Delegate is here, and it doesn't seem to answer my question.

JSF 2.0 can work very nicely with Groovy, and I understand that the lack of a spec is making it difficult for the JSF spec to acknowledge that fact. Hopefully, one of these days, the Groovy folks will get around to a formal spec.

Dan Allen gave a great presentation on running Seam on Glassfish, and what pitfalls one encounters. Mostly, the issues are JNDI naming, exploded WARs, and other distasteful topics. It all adds a dose of reality to app server portability.

Sharat Chander and someone who admitted to being in marketing talked about Project Kenai. David Geary and myself are hosting a project there for our Core JSF book. The site works just fine, but I never understood why it describes itself as “more than a forge”. The speakers were hinting at great things to come, in terms of continuous integration, testing, and deployment, so that will definitely be worth watching.

I met up with Dennis Cosgrove of alice.org at the show floor. If you haven't checked out Alice, do it now! It is a super-cool environment to teach programming to middle and high school kids. The new version—now in beta—has two enhancements. It has characters from the Sims that are a lot smoother than the old wireframes. And you can program in Netbeans, in addition to the Alice IDE. Next semester, I will try this out on freshman students, replacing the old “print all prime numbers < n” with problems that use the Alice cast of characters.

My favorite talk of the day was a “lightning talk” by Masafumi Ohta on running OpenSolaris on an Eee PC. Now here is a true hacker. Apparently he even got Second Life running!

Finally, I stumbled into a “bring your own laptop” lab on the Eclipse Glassfish plugin, brought to you by Ludovic Champenois (AKA Ludo). I had used that plugin with good success, as did my software engineering students last semester. We used Java EE 6 + JSF 2.0 on Glassfish v3 with Eclipse, and it all worked out. Except, that there was some flakiness with the adapter. My students figured out how to solve this by downloading the Eclipse + adapter + JavaDB bundle that Ludo provides, but I stubbornly refused to do that and ran into grief when Glassfish v3 updated. It turns out that you need to manually check the update site for the plugin.

(It doesn't help that the update site is called https://ajax.dev.java.net/eclipse.)

When the Glassfish plugin broke for me, I had a miserable time testing my JSF 2.0 examples with Tomcat for the last several weeks. I look forward to going back to Glassfish! If you are still using Tomcat, you should really have another look at Glassfish or another app server.

This year, Sun has been very generous in admitting students to Java One for free. In fact, one of the lab participants who ran into trouble in that lab turned out to be one of my students—good choice on her part; she is starting a master's project using this stuff. I ended up being pressed into service with troubleshooting because she ran Linux. The issue was a space in a file name :-)

This being day 0, I have no profound observations yet. There seems to be cautious optimism about EE 6, JSF 2.0 and even OpenSolaris and Java FX on the conference floor. Interestingly, I ran into a group of my students and asked where they were going. The cloud talks, duh.