Last summer, Sun announced the JavaFX project. JavaFX is a new platform with a new scripting-like language generally considered as a competition of Rich Internet Application (RIA) frameworks, such as Microsoft Silverlight, Adobe Flash/AIR, and all AJAX technologies. These technology delivers client-side programs through the browser, thus offload the server from laying out the screen, and enhance the user interactivity.
The concept is nothing new, especially for Java platform. In 1995, Java applet was the world's first RIA framework. It was widely supported in both Netscape and Internet Explorer browser. Lots of business application rewrites into Java applet during the dot com age, and eventually all kinds of problem occurred. Ten years past, most of the rich internet experiences are now delivered by Adobe Flash or AJAX. Java applet is no longer the favorite choice for rich applications. In my understanding, there are several reasons that cause the Java applet market share decline:
- Java Runtime Environment (JRE) installation size. The first generation browsers came with the Java Runtime. Even if they don't, the first generation of JRE is only around 2.4MB. Java 2 doubled the installation footprint, which is considered huge in that time. Java 1.4 doubled the Java 2 installation size, which is again considered huge even now.
- Long startup time. This is probably one of the most complain about applet: Slow graphic user-interface (GUI) startup time. Most of the time we see a gray box in the middle of the browser and the hard drive starts churning. Finally JRE is started, and then we see another delay for applet loading.
- Painful GUI design. Java is a general purpose language. Using Java for GUI layout is really tedious. Early version of JRE also suffer on lightweight component slowness. Lightweight component allows Java to draw its own buttons, labels and other GUIs instead of using the native peers. Lightweight component itself is not a bad thing, but the first few generations of lightweight component don't use native code for acceleration. You can literally see the components being drawn to screen one by one in the early Java 2 releases.
- Bad client app design because Java has too many features. Lot of client-server application was directly ported into Java applet and eventually failed during dot com age. Rich user experience means smooth interface response. Business logic need to be carefully designed to avoid code bloat on client side.
- Lack of rich media support. It is require lots of effort to integrate media into applet with third party tools. The standard way of media playing (JMF) has very limited support.
JavaFX together with Java 6 update 10 is Sun's answer to these issues. If you need to write an RIA in Java, JavaFX with Java 6 update 10 might be the best solution. Base on what I read, here is how Java come back to RIA:
- Java 6 u10 initial runtime download size is similar to the early Java 1.1
- Faster cold start time
- Faster lightweight GUI
- JavaFX scripting language is more friendly to GUI layout and tool support
- Rich media support
I don't know if JavaFX will become a popular RIA platform, but I am sure for my next Java GUI project, I will not directly code into Swing anymore. Using a different language gives developer a chance to think what should be in the GUI layer and what should be designed elsewhere. This should promote some good thinking for application design. I am sure JavaFX will survive, but I am still not sure if it will success.
No comments:
Post a Comment