Friday 15 December 2006

JavaPolis

Today, two collegues and I went to JavaPolis, courtesy of our employer. After a breakfast of stale pastry, we attended the keynotes session, kicked off by Marc Fleury of JBoss talking about different models of employing open-source software in a commercial setting. His talk was followed by the results of the JavaPolis RADRace®, a variation on The Original RAD Race®. Next up was Erich Gamma (one quarter of the Gang of Four) with a presentation about the history of Eclipse and how they do release iterations.


After the break I went to the "Integrating XML into the Java™ Programming Language" presentation by Mark Reinhold. His speech was about the proposed integration of XML into Java itself, as the title might have suggested. His proposal is still in its infant stage, it not even having a JSR (yet). He was also a bit vague about the use of namespaces and attributes (he only showed tags and element contents in his examples).


The lunch break featured some horrible interpretation of burger-like sandwiches filled with green stuff pretending to be lettuce, red stuff masquerading as a slice of tomato and filler stuff that was labeled to be surimi, tuna or something else, but somehow managing to taste exactly the same as every other filler. The whole thing was wrapped in plastic and labeled so that consumers would know what the filler should taste like (a kind of autosuggestion, I believe).


After lunch we went to the "XFire Web Services" talk by Dan Diephouse. A bit of a boring promo-talk about XFire by a guy with no presentation skills (compared with Erich and Mark, at least). I hadn't prepared this one, so I must admit I didn't have enough background knowledge to completely understand everything. His using at least two acronyms in each sentence didn't make things easier either.


Next up were Bruno Lowagie and Paulo Soares, authors of iText and the primary reason I was there today. The presentation was not so much about iText as about Bruno's first book, published just in time for this conference. We spent the thirty minute break bewteen presentations asking them some questions and offering Bruno a bottle of champagne (partly to congratulate him with his book and work on iText, partly to get him more willing to answer questions; in this world it's all a matter of greasing the right gear at the right time). Paulo apparently doesn't drink alcohol.


After the break, I went to Neal Gafter's presentation of his proposal to put closures in Java. As I was brought up in a functional programming and language design world, this was one of the really interesting topics of the day. Currently, something similar to closures can be achieved in Java using anonymous inner classes, but this system has a lot of drawbacks: there is a lot of typing involved (on the keyboard that is), return statements not always return to the scope you want, you're very restricted in your usage of identifiers declared outside the inner class, etc. Closures would also be the solution to all SIGs competing for the addition of their own proposed control constructs as special forms to the Java language: with closures, you can define your own new constructs, without the need for the language being extended (extreme examples exist: in Scheme and Lisp you can write just about anything using only lambdas).
As an example, consider the following problem: you want to perform some kind of operation, time how long it takes to execute, and log this time. The classical Java approach would be:

void operation() { ... }

void timeOperation()
{
long start = System.nanoTime();
boolean success = false;
try
{
operation();
success = true;
}
finally
{
logTime("Operation", success, System.nanoTime()-start);
}
}

If Java would have closures, the timeOperation method could be replaced entirely by something similar to this:

time("Operation")
{
operation();
}

Not only is this way much shorter to write, the time method would also be reusable to record timing for any operation you want!


The last talk I went to was a disaster: "Java and .NET interop" by Ted Neward. Next time, try to install and test your demos, together with any and all software they need, Ted. It might also be a good idea to fully charge your laptop battery beforehand.


The buzzword of the day was: POJOs! If you don't know what the acronym means, some speakers might fool you into believing it's the next big thing coming up. It actually means "Plain Old Java Objects."

2 comments:

Anonymous said...

All feedback on the iText talk can be posted on this page.

Bertje said...

It seems someone has been googling...

Just to make things clear, the grease (champagne) wasn't needed at all: both Bruno and Paulo were very friendly and willing to answer any questions.