Java One Day 0

???This year, I got a genuine press pass from a kindly soul at Sun, which entitles me to priority seating at the keynote, the opportunity to ask hard-hitting questions in the press conferences and unlimited free booze in the press lounge (I hope).


???The day started with an 8am conference call for Java Champions, an august group of Java evangelists. Bob Brewin was supposed to tell us all about F3, erm, JavaFX, except he got cold feet at the last minute, and he only gave out vague generalities about the resurgence of web-delivered desktop apps. I practiced my “reporter asking hard-hitting questions” persona and asked him why applet/Web Start/JVM versioning on the desktop was in such sorry state, and why it didn't get enough engineering attention at Sun. He agreed that this was a problem. This InfoWorld article has the actual JavaFX news.


Last year, there was a free NetBeans day at the Argent, erm, Westin San Francisco Market Street Hotel. It was very crowded, so I was glad to see it moved to Moscone this year. There were several other tracks too, on GlassFish, Linux/Solaris, and Web 2.0. The NetBeans track. had a slick presentation covering GUI builder improvements in NetBeans 6 and a nifty demo involving JXMapViewer. This isn't your grandparents' NetBeans.

Another NetBeans presentation showed the Ruby support. I must admit that I have never quite caught the Ruby/Rails train. Ruby looks nice enough, but it doesn't really solve a problem that I have. People told me that duck typing would bring me freedom. I tried using Groovy for some data manipulation work, figuring it would be easier to pick up than Ruby. I ended up going back to Java. Sure, Groovy has a prettier loop for iterating through the lines of a file, but in the end I preferred autocompletion in the IDE and compile-time error checking.

Rails addresses a pain point (Java web applications), but I was never able to get past the example that shows

some Ruby loop structure 

JSF may be no walk in the park, but at least I don't have to worry about HTML table tags—I just use a h:dataTable and bind it to a list of objects. What would I do in Rails if I had to stripe every second row with a background color? Write nested loops???

Sure enough, the same code showed up on today's slides.

There was a demonstration of a Rails debugger that lets you set breakpoints in a mess of HTML+Ruby code. But only if you use the right kind of debugger. That looks like work in progress, but overall it is pretty amazing that you can do so much Ruby work in NetBeans.

In the last talk of the day, a fellow who had been programming Java for all of seven months showed off his SunSPOT powered app that rewarded his dog with food pellets. What did he use for his web UI? The NetBeans wizard for JSF.


The No Fluff folks hosted a presentation on Groovy and Grails at the trendy W hotel. I was glad I went. Much better food than the awful Moscone fare. (Before today, I had never had soggy pretzels.) Nice presentations by the Groovy and Grails gurus, Guillaume Laforge and Graeme Rocher.

I really want to like Groovy. It looks like Java and it is tightly integrated into the JVM. My problem is that I don't understand it. When I first saw it a couple of years ago, I found out to my horror that there was no grammar. The only way to check the meaning of an expression was to feed it to the interpreter du jour. They fixed that now. A few weeks ago, I used Groovy as an example for metaprogramming in my graduate programming languages course. I had a nifty lab where I added a method to java.awt.Point. Trouble was, the method was not inherited. I spent a few hours looking at scarce documentation and a complex implementation. I was unable to find a spec for the MOP. Being the hard-hitting reporter, I cornered Guillaume who cheerfully agreed that no such spec existed. The MOP is whatever it is in the implementation du jour. These things make me appreciate the Java culture of “one specification, multiple implementations”.