Skip to main content

Java One 2009 Day 2

Posted by cayhorstmann on June 4, 2009 at 12:02 AM PDT

The keynote

I do this to myself every year. I go to the opening keynote on Tuesday. I suffer through the love-in-with-Sun-partners part, just so I can get to the good part with the important announcements. Then I go to the Wednesday keynote, which offers no such benefit, and vow never to go to any other keynote except for James Gosling's toy show.

Today's mobility keynote was easily the most painful in my memory. Some fellow from Sony Ericsson broke into rambling monologes that left his stage partners speechless, and he had an inexhaustible supply of platitudes (such as "Every user is unique" and "You can be a part of the total experience") that work better in the executive suite than a gathering of engineers.

He seemed a bit taken aback that the audience didn't "get" the idea of "monetizing" the 200 million Sony Ericsson phones out there. But help is on the way, in the form of another app store. Oh goody...

The store has been around for some time, selling ring tones, games, music, and movies. Unlike the Java app store, they figured out how to take money. After July 1, you can submit your apps (without having to pay a fee, which is apparently customary in the game biz), and they'll review it within 30 days. For their trouble, there will be a 70/30 "rev share".

I think I'll skip the other keynotes.

JUG Meeting With James Gosling/Buzz from the Floor/Radio Interview

Van Riper kindly invited me to the Silicon Valley JUG meeting with James Gosling. JUG members and students asked lots of very interesting questions. A few random answers that I remember, hopefully accurately:

  • In hindsight, there aren't many things that should have been changed in Java 14 years ago. The C++ like syntax was necessary for wide adoption, and it was important to get it out then rather than waiting any longer.
  • Functional programming is great, but a lot of people have a hard time thinking that way.
  • Those alternatives to locking sound seductive at first, but not many problems map into it in a way that is natural to most programmers.
  • Google Android pays little attention to keeping a common standard, and there will be nasty surprises when every vendor does their own extensions.

People asked about "buzz from the floor", such as "Why isn't there a banner advertising next year's Java One, like there used to be in the past?" James didn't know. But he did know what was behind the rumor that he coached Larry Ellison in Java FX programming. It was not so. Larry just downloaded the SDK and hacked together some stuff on his own. Later, I told that story to some engineers, and they inquired whether it was really Larry who did it, and not his personal hacker.

radio.jpeg

Unfortunately, I had to run off early to give a Java One Radio interview. The recording should be available here.

Technical Sessions

I attended Jonas Bonér's session entitled "State--You are doing it wrong". Jonas reviewed three alternatives to standard locking: Software transactional memory (with Clojure), actors (with Scala), and data flow, which he called "the forgotten paradigm". He wrote a custom library for data on top of Scala actors. It wasn't very deep, but I learned

  • In data flow, deadlocks are deterministic. Run your program again, and it deadlocks in the same way.
  • STM isn't a free lunch--one can spend a lot of time retrying transactions

Alex Miller gave a talk on concurrency gotcha's, with good old fashioned locks. The talk was very well attended--clearly, interest in concurrency has reached the mainstream. Most of the gotchas were pretty familiar, such as the shared DateFormat. (I really hope the date and time API makes it into Java 7. Haven't we suffered enough?) I liked the slide:

synchronized(what goes here?)

I had students who would just try filling in one thing after another into that slot...

jaws.jpeg

I tell students that they should just stay away from synchronized blocks unless they really know what they are doing. Reentrant locks seem easier to understand. Of course, there is a way of snatching defeat from the jaws of victory, also covered in Alex' presentation:

public static final Lock LOCK = new ReentrantLock();
synchronized(LOCK) { ... }

JSR 299

My final presentation was Gavin King's talk on WebBeans, erm, Contexts and Dependency Injection or JSR 299. Gavin is an opinionated speaker--good thing his opinions were pretty close to mine. He was very enthusiastic about EE6 (provided, of course, it includes JSR 299). As he puts it, finally the EE stack will be fully usable without 3rd party addons.

The web profile removes a lot of old cruft. I agree--cruft removal is excellent. He says JavaMail should have been added. Agreed too--all my web apps seem to need JavaMail, usually for password recovery.

He spoke kindly of JSF 2.0. It fixes "all the problems". Ed Burns, whom I met later at the Java EE party, basked in that statement :-)

There are a lot of things to like in WebBeans, erm, Contexts and Dependency Injection. Gavin will tell you about the benefits of loose coupling with strong typing. But I'll be more pragmatic.

  • JSR 299 gives us @ConversationScoped (think multiple NumberGuess games in different browser tabs). Maybe that should have been part of JSF 2.0, but I take it any way I can get it.
  • Your JSF apps can reach stateful session beans directly from JSF pages, without having to fuss with managed beans. If you are willing to deploy on a real app server (and not Tomcat), that greatly simplifies your architecture. I am not saying that every web app should do that, but it is a very useful option to have, as evidenced by the success of Seam.
  • JSR 299 has a very clean approach to switching between testing and deployment scenarios.

Gavin promises a proposed final draft of the spec by Monday. During the Q&A, he sad that, in hindsight, JSR 299 should maybe have been an SE JSR. I asked about potential conflicts with 330? Gavin said that JSR 299 has no (portable) solution to a standalone bootstrap outside a Java EE container, which JSR 330 provides. He'll be glad to adopt whatever they come up with. But the fact remains that there are gratuitous naming differences between the JSRs.

At the Java EE party, Ed Burns introduced me to Bill Shannon who oversees Java EE. Bill seemed genuinely perturbed by the conflict between the two JSRs. I hope this gets resolved in a positive way. As an app developer, I really want the benefits of WebBeans in Java EE 6. Sure, I could always use Seam, but that removes the "one stop shopping" advantage from Java EE.

winchester.jpeg

At dinner with my co-author, David Geary, and my editor, Greg Doench, we talked about the Winchester Mystery House, the building constructed by the widow of the gun manufacturer who was obsessed about the spirits of those killed by the guns. The house has over a hundred rooms, most with no purpose, windows that don't open, and stairs that lead to nowhere. As one of the dinner companions remarked, just like the JSF spec. Ouch!

Tomorrow, too early in the morning, David and I will be in a Second Life chat. Please join in if you are into that kind of thing.

Comments

Cay - Thanks for the update. I spent most of my time with the Java DB team. I did go to a panel on MSA 2, and yes to James G.'s toy show, which I agree continues to be the best part. I also spent some time on the pavilion floor. Pulse smartpen products were interesting given that I'm generally interested in "paper" and "pen" as technologies. I'm glad to hear about your assessment that concurrency issues are making it into the public. Before this interest rises any more highly, it is likely that new languages will send it back to were it was ... :-)

I agree with augusto. No visible presence except for Larry Ellison's appearance. This may well have been on purpose while the acquisition is pending. If anyone from Oracle wants candid comments about controversial Java issues, they surely know where to get them...but nobody has contacted me :-)

ptux. There is no visible Oracle presence, they didn't even have a booth this year. I posted a blog entry about this and as I hit publish Larry Ellison walks in front of me to get ready for his appearance. So the Oracle presence was Larry Ellison on Tuesday. There were some Oracle employees, quietly attending some sessions. I was in a particular one that after a very ... "enthusiastic" discussion ... he pulled me aside to get my opinion on some things going on with a potentially controversial addition to the Java language in 7. It almost felt like they were "scoping out" their soon to be new company :-)

I thoroughly enjoyed reading your blog coverage, Cay. Thanks for all the shrewd, well thought-out, and humorous observations. Marina

Very nice. I always find your humor amusing. I was really considering attending the conference, after several free invitations... started working this week, though, so I am following the proceedings from home. Wonder how big of a presence Oracle has there?