This is just a quick note about the WJAX Java developer conference that take place last week in Munich.
The conference program was quite balanced and beside the main stream topics about SOA (ServiceOrientedArchitektur - represented by the SOACon conference), Spring, Application Security and OSGi there was a huge number of different topics, which were addressed by several talks.
Most interesting from my point of view were following sessions:
Keynote from Jonas Jacobi: Re-architecting the Web with HTML 5 Communication.
Talk from Karsten Lentzsch: Efficient design of swing UI’s.
Talk from Angelika Langer: Java programming in the age of multicore.
Talk from Dierk Koenig: RESTful JEE with Grails.
Canoo was exhibiting on a booth, which gave the great opportunity to present and talk about our products UltraLightClient (ULC), the just released language application for the IPhone (using canoo.net), our demo for the new JavaFX platform and fancy UltraLightClient / Swing rich client applications. In addition Canoo members used the presence to keep in touch with existing costumers, contact new ones or presented the company to potential new staff members.
Canoo Online Quiz
All the visitors on the booth and all other interested software developers had and still have the possibility to join an online quiz. Its possible to win an iPod touch or one of ten ‘Groovy in Action’ books. The quiz can be found at www.canoo.com/quiz and will end at the 30.11.2008.
Dierk König, Canoo fellow and author of the ‘Groovy in Action’ book, was holding a groovy workshop and was giving a talk about RESTful JEE with Grails.
One of the many interesting talks I attended at the JavaPolis 2007 conference was the Swinging RIA talk. At the end of the talk Chet Haase announced the brand new Java Scene Graph library. Scene Graph gives you a new way to implement your visual output in Swing. It will replace the Jazz library that provides the Java2D stuff in the current JavaFX implementation. In the current release, the API is a little bit verbose but I expect this to change as the API is not final yet.
How does Scene Graph work? With Scene Graph, instead of subclassing a Swing component and providing your Java2D drawing instructions in a custom paint() method, you build up a data structure that declares your visual output, i.e old Java2D is the procedural approach to do graphics, whereas Scene Graph is the declarative approach.
How does this look in practice? In Scene Graph you amazingly build up a scene graph! Each scene graph is composed of nodes and each node represents a graphics operation, e.g.
SGText result = new SGText();
result.setText("Scene");
result.setFont(new Font("Arial", Font.BOLD, 128));
result.setAntialiasingHint(VALUE_TEXT_ANTIALIAS_ON);
result.setLocation(new Point(50, 180));
My impression is that a programmer familiar with Java2D is immediately productive with the Scene Graph library. Great! And as a bonus he gets good effect and animation support for free! Wow! I hope this is just a first step to:
Powerful effect libraries
Good animation libraries
Visual scene graph tools
Integrations into existing visual tools like PhotoShop
…
Another thing that makes building good-looking Swing applications easy! Good!
Not being able to attend the conference yesterday, I not only missed some interesting talks, but also Bruce Willis in “Die Hard 4″ ;-(
In today’s keynote, Neal Gafter of Google talked about the possibilities of closures and how they can reduce the amount of boilerplate code and increase the readability of software. In addition, by integrating closures into Java some language feature requests would change to library (API) feature requests, which have a much greater chance to become included.
Danny Coward from Sun showed the road map regarding Java SE and Java EE. He also explained how open source complements the JCP process.
Today was also filled by a lot of networking. That’s what I like about conferences, you meet new people. And people you only know by email suddenly get a face and a voice.
One of them was Kaspar von Gunten. He gave a talk about Process-based Software Development today. He showed how the process modelled approach can change the development of software towards end-user programming. And how this approach integrates with RIA. They also showed a Software Demo of their product Xpert.ivy. The new release of Xpert.ivy is based on Eclipse and a graphical process designer. In addition it uses ULC Visual Editor to generate the UI for the RIA front-end of these processes. Quite impressive. Xpert.ivy 4.0 will be shipped in 2008.
I didn’t get much out of the talk about Jackrabbit. I almost got discouraged to use Jackrabbit, being warned to be patient and reading the spec to get the information about how to use the API.
For the closing session they decided to do some lightning speaks: Everybody could speak up for 2 minutes. Neal Gafter started showing some optical illusions from the Java puzzler book. Then Felipe Gaucho presented his footprint.dev.java.net project. We were then given the elevator story of the semantic web - basically everything is replaced with URI. Then somebody told us good reasons why to attend Jazoon 2008 (reasons like Euro 08 or because the weather will be better). And then we learned what we should read to become a better Java developer:
Joe Armstrong’s thesis: Concurrency oriented languages.
Functional languages explained.
Understand your manager: One minute manager meets the monkeys.
Shell scripting (because there are so many bad shell scripts around)
After that Gregory Murray showed how to impress managers: Do rapid prototyping with Jmaki. Some other guys followed. I was actually pretty amazed how much you can say in 2 minutes.
That was about it. Thank you to all who made this event happen!
The source code contains an Eclipse project file and a build script, which allows you to build it yourself (after having adjusted the build.properties):
Currently a number of different Rich Internet Application (RIA) technologies are emerging, each with their own strengths and weaknesses. In many cases a combination of technologies can be used to meet application requirements. This session shows, based on examples, how various technologies such as AJAX, Swing and Flash can be integrated into one application.
Now for the final stretch of this year’s JavaOne conference: the pavilion closed on Thursday and we dismantled the booth pretty quickly. After half an hour everything was packed and we took our equipment back to the hotel. Hence, today I could really enjoy the conference without any booth duties.
“Comparing the Developer Experience of Java EE 5.0, Ruby on Rails, and Grails” looked really promising to me. I know Java EE from real programming practice, Rails and Grails just from reading some articles. The speaker, Thomas Daily, had a funny Australian accent and made quite a good show. He demonstrated how easy it is to create a simple CRUD application with all three technologies. For Java EE he had to use heavy machinery (i.e. NetBeans), though. He then presented some performance benchmarks which claimed that Java EE scales way better. The runner-up was Grails, followed by Rails. Tom Daily was somewhat biased towards Java EE (he doesn’t work for Sun for no reason), although his final recommendation was to use the tool that best fits the application. What I missed in this talk was some statements about maintainability. I would have liked to see how each of these environments coped with new requirements.
Hard core stuff was up next with “Cranking up Java Application Performance with DTrace“. DTrace allows to run instrumented code with zero impact on performance. At run time you can activate/deactivate probes in a live system. Right now, DTrace is only available on Solaris 10, but it will be available on at least one other operating system later this year. The Java VM is also instrumented, which allows to use DTrace at run-time for Java applications as well (Java 5 and newer). For Java 7 it is even planned to allow for statically adding probes to the application code. DTrace can produce a vast amount of tracing data in almost no time but the DTrace language helps to filter and aggregate this data. DTrace solves the developer’s dilemma: adding tracing statements is necessary for systemic analysis but even when switched off it usually has some impact on performance.
Java Champion Adam Bien gave a talk on “Java 6 Platform, Java DB, Swing, JNLP, Java Persistence API: The New Operating for Rich Internet Applications“. He covered a lot of ground in one hour and proved to be one of the überarchitects. Adam Bien strongly recommended to use business objects (i.e. real objects with state and behaviour) rather than SOA with dumb objects such as DTOs. The Java 6 platform and JPA make it even possible to run these business objects either on the server-side in an EJB container or on the client side outside of a container. However, I missed two topics. First, he talked a lot about the thin client challenge by which he did not mean real thin clients (i.e. presentation logic is on the server-side) but “thin clients” with just the presentation logic running on the client side. Some of these challenges do not come up with server-side presentation logic. Secondly, he should have at least mentioned approaches how to synchronize client-side database changes back to the server. Nevertheless, get hold of the slides and dive into this wealth of information.
I closed JavaOne 2007 with Neil Gafter’s “Closures for the Java Programming Language“. Neil Gafter is a brilliant speaker: perfect pace, well pronounced, deeply reflected - it’s just a pleasure to listen to him. He started with a number of cases where anonymous classes are not sufficient and argued how closures would help. Some of the code examples reminded me of my code and how I had to work around the limitations of anonymous classes. I used to develop in Smalltalk for quite some time and blocks are as natural as recursion (quoting Neil Gafter). He also argued how the Java API could be improved with closures. However, I am still undecided whether the Java language should be extended with closures. What once was a fairly small and clean language is gradually turning into a dreadnought. Java should have offered closures from the very beginning; adding it as an afterthought might have too much negative impact.
I don’t get much sleep during JavaOne. Days are long even if you don’t attend any late night BOFs and the jetlag gets me out of bed pretty early. On the third day I start get feeling the lack of sleep and I am not too unhappy that JavaOne lasts only four days rather than five as in previous years.
My first session in the morning was “Java Persistence API: Portability Do’s and Don’ts”. I have been using Solarmetric Kodo (now with BEA) for some years and although I am not using the latest version I am still quite pleased with the functionality. The latest version of Kodo also supports JPA and therefore I was curious how JPA can be used with portability in mind. Mike Keith explained how the JPA specification was specifically designed such that vendors could add specific functionality without interfering with other vendors. A developer can refer to vendor specifics both at the property and query level and it’s quite easy to support more than one vendor. It reminded me a lot of JDO which has similar capabilities. The only thing that’s missing is a portable approach for pessimistic locking.
“Designing Scalable High Performance Rich Clients: From the Trenches” was up next. Rob Ratcliffe took part in the development of a complex Swing-based application which monitors and controls a potentially large number of mobile sensors. The talk was less than convincing, his demo nice in the beginning but way too long so I left early. If somebody tries to teach to me the advantages and disadvantages of a singleton I am definitely in the wrong session.
I was looking forward to Ben Galbraith’s talk about “Debugging Swing Apps” and I wasn’t disappointed. Ben is a brilliant presenter, although he speaks incredibly fast which might be a challenge to some people in the audience. I admired the two sign language interpreters who somehow managed to keep up with his speed (they had to take turns every ten minutes). Ben explained how to use weak references for easy fixing of memory leaks and how AOP can help to identify code that leads to sluggish user interfaces. At the end he demonstrated a tool he wrote to experiment with Java 2D, e.g. trying out Java 2D calls interactively to gauge the impact of options on different platforms. To summarize, the talk was both filled with lots of useful information and entertaining. I was quite amused when Ben tried to dodge the Apple NDA while explaining some garbage collection features on Mac OS X.
The title of “Spaghetti Is Not Tasty: Architecting Full-Scale Swing Apps” was promising but did not meet my expectations. Rather than focusing on design problems of large Swing applications he spent too much time on OSGI which can solve some problems but not all of it. The only thing I took from this talk is that for large applications it is recommended to use a message bus to distribute events, which was also mentioned by Rob Ratcliffe in his talk. Wiring listeners to too many consumers does not scale and is hardly maintainable,
My last session was about “Garbage-Collection Friendly Programming“. Three garbage-collecting engineers from Sun laid out all the do’s and don’ts in Java to effectively deal with garbage collection:
Don’t use object pools. Java’s memory management is usually way better than Java developers can implement object pools.
Don’t use System.gc(): The garbage collector knows better when to run, you don’t have to tell it.
Resizing arrays frequently can put more pressure on the garbage collector
Finalize always takes two garbage collection cycles and is therefore quite inefficient. For Java 6 the garbage collection team even convinced the AWT-team to remove all finalize methods from the AWT (and therefore Swing) components. If you need something like finalize you can either use a finally clause or weak references.
Don’t use soft references, because it is expensive for the garbage collector to reclaim objects referenced softly. Only use soft references for quick and small caches. This contradicts what Ben Galbraith said in his session when he recommended soft references for any kind of cache.
If you have a chance to grab the slides, just do it. They contain numerous hints how to write clean and efficient code with respect to memory management.
The third day was kind of a mixed experience. I learned most in the sessions about Swing Debugging and Garbage Collection. With the other two Swing sessions the JavaOne program committee made some questionable decisions.
My second day at JavaOne started off with Joe Winchester, one of the most entertaining speakers at this conference. I still remember last year’s session: first, I helped to prepare one of the demos and all sorts of technical issues came up during this but eventually we managed to get it running; secondly, it was standing room only and Joe drew many laughs with his presentation. This year’s presentation was about “User Interfaces: The Good, the Bad and the Ugly“. Basically, it was along the same line as last year’s presentation. Joe is brilliant in finding all sorts of user interface screw-ups. After the session he told me that he is not actively looking for this but just stumbles over them while browsing. He started his talk with some remarks on the paper-based view of the world. WYSIWYG still dominates the design of most user interfaces but also limits their design. Jeff Raskin, the creator of the Macintosh, hated this view. He compared it to a Boeing 747 with its wings ripped off and used as a bus. Joe then made fun of desperate attempts of developers to cover up their mistakes, like using animation to distract the user from a slow and unusable user interface. He also demonstrated some progress bar examples which just kidded the user (without the developer’s intention). The culmination of his talk were two videos about the user interface of a scale in the fruit/vegetable department of a supermarket. The first video showed Joe trying to weigh some bananas and the scale keeps telling him that it can’t do it because it is out of stock which slightly contradicted the fact that Joe put real bananas on the scale. In the second video Joe tried to weigh some tomatoes on the same scale and the scale asked him what kind of tomatoes he has got and for each variance showed him exactly the same picture. At the end Joe called out at the Web developers to get serious after having more than enough fun. What I missed in his talk were solutions to the problems he showed. Joe told me afterwards that he still had one third of the slides left at the end, so maybe he could have talked about these solutions. Overall, the session was well above average, but I think it was not as good as last year’s session. It also drew less attendees than last year which is true for all the sequels I have seen so far.
The next session titled “Filthy Rich Clients: Talk Dirty to Me” was held by Chet Haase and Romain Guy. They claimed that this is a presentation based on a book based on a presentation. Hence, rather than wait for their book “Filthy Rich Clients” one could get a good overview of their ideas about pimping up a Swing GUI. I first expected something like “Extreme GUI Makeover” but soon realized that this was just the low-level version of this session. They talked about different approaches in achieving better GUI performance. The timing framework developed by Chet Haase was another topic. Most time was spent on how to achieve coolness, like blur, drop shadows, spring, morphing etc. I didn’t mind the low-levelness of this talk but it was kind of boring. Romain tried to make some jokes which did not catch on but maybe it was still too early in the morning for him or the audience or both.
“Extreme GUI Makeover 2007” was the second sequel of the well-known user interface presentation by Romain Guy and his colleagues. As with most movies after too many sequels this show is getting a bit long in the tooth. This time they chose to enhance a “real” business application, in this case a real estate application. After some minor improvements to the application’s appearance such as changing the look and feel, adding customized components and a nice splash screen they showed off some impressive changes to a table. Their cell renderer was quite complex and included pictures, several lines of text and spanning. The coolest feature was their sorting animation which visualized how rows changed their position when being sorted. They also created an out-of-the-frame non-rectangular and transparent window which tracked the current selection in the table like a kind of tooltip. Finally, Romain demonstrated how to convey exceptions to a user in a funny way (how about developers covering up their mistakes). He created an animation which ripped off the surface of the window and showed the ugly internals of the application which had gone wrong. To summarize, I think they should not try to create another sequel next year but come up with something completely different.
This day’s sessions were informative and sometimes entertaining. However, I was missing last years’ excitement. Maybe cool Java desktop applications are becoming just normal which is a good sign.
The first session I attended was titled “Java Desktop“. It was good to hear about the progress Sun is making to provide Java on as many desktops as possible. The vast majority of Java VMs out there are now some version of Java SE rather than the outdated Microsoft VM and about 60% of the PCs are equipped with Java by default. If you have the impression that Java is mainly used on the back-end you have to think again. According to Sun, most Java development time is spent on Java desktop applications. This clearly underlines the importance of Java client development. Maybe it is also a sign that Java development for the desktop is still too hard and takes too much time.
In any case, they are working hard on several issues to lower the barrier for installation of the Java VM and the use of Java applications on the desktop:
A coldstart of the Java VM, which now takes way too long (5-10 secs) will get a lot faster. Starting the Java VM puts a heavy load on file system access. Hence, they preload the necessary files in the Windows disk cache to bring down startup time.
The JRE install will get much smaller, i.e. one has only to download a kernel of about 2MB rather the full 13MB. All the other components will get downloaded either lazily or on demand. Typical applications need only a fraction of the entire JRE, for example SwingSet requires about 3.5 MB, Limewire about 4MB.
Another pain for developers is figuring out the JVM versions available on a desktop. Java Web Start already does a pretty good job, but for applets it’s a challenging task. Sun will provide a number of JavaScripts that help in figuring out JVM versions. An upcoming Java plugin (Windows only) will help even more.
All these extensions will be made available as part of an update for Java 6 for consumers in the first half of 2008. Sun’s goal is to make the Java SE platform the consumer web client of the future. This is really good news for technologies like UltraLightClient which try to leverage the power of Java, both on the server and the client side.
The next session was about the Swing Application Framework. Hans Muller, one of the leads, gave a brief introduction into this framework. The Swing Application Framework is targeted at small and medium sized Swing applications. One of the goals was to keep it so simple that you can cover the entire framework in an hour’s presentation, which Hans actually did. This is in contrast to most application frameworks which try to cover the entire application problem space and usually turn out as untameable monsters. The Swing Application Framework just handles the few issues which probably every Swing developers had to find some solution for. They are:
Resources: easy resource conversion and even resource injection into properties by annotation.
Actions: actions are defined by annotating methods, their state can be bound to a property, and the action attributes can be loaded from resources as well.
Tasks: everything you need to run background tasks including notifying the user about the state of the background task.
Storing session state: make your application’s state persistent and reload it when starting the application again.
If you are developing Swing-based application then have a look at this framework. It most likely will make your life easier. The framework is planned for inclusion in Java 7.
My third session was about “Easy deployment is finally here“. Basically, it was a more in-depth rerun of “Java Desktop”. The only addition was a demonstration of the new Java installer which is definitely more user friendly. Java updates will also become more lightweight and they will update in place rather than proliferating Java versions on your PC. One remark of Ethan Nicholas slightly amused me: he claimed that Mac users have to get a new version of the operating system in order to update their Java version which is simply not true.
The last session was “Swing in a Multithreaded World“. This was mostly about the SwingWorker class which is part of Java 6. It gave some valuable tips and tricks how to efficiently use the SwingWorker class and how to implement custom executors. The presenter was talking really fast, it felt like he tried to cover up for his Russian accent which made it hardly comprehensible. As a result, the one hour session was over after 30 minutes. If you are using an earlier version of Java: there is a backport of the SwingWorker implementation available at https://swingworker.dev.java.net/.