Thursday December 06, 2007 In the next talk on NetBeans Day in Frankfurt, Roman showed us how to create a RIA with Netbeans. In case you never heard of the acronym RIA: RIAs are interactive and (hopefully) userfriendly rich internet applications.
As opposed to, say, an HTML form, they can do everything a desktop app can, but in comparison to a desktop app, you don't need to install the RIA (instead, you start it via your web browser). So are RIAs better? "It depends" on the application. On the one hand, you save time and disk space, but on the other, you are dependent on your internet connection and the RIA provider.
Examples for RIA technologies that you use every day are Java applets, interactive Flash or ActiveX web pages, AJAX/JavaScript-enhanced pages, or web-starting Java applications (JNLP). And as soon as the tools are released, JavaFX will be another option (more below).
And speaking of Java applets: They kinda used to be the "mother of RIA". If you knew Java, you could build a powerful interactive platform-independent browser applet, without the need to learn a whole new technology like ActionScript or ActiveX. So why are there so many Flash pages? The advantage of these other technologies over Applets is that they presently are more responsive, and load faster in the browser. If it wasn't for the performance, I would rather reuse my existing Java code and write Applets, instead of learning ActionScript and starting from scratch. Roman mentioned that Applet performance is one of the things getting fixed in the upcoming JDK6 updates, and there are also plans to make it as easy to install the Applet plugin as it is to install the Flash plugin - sounds cool, I think I will give Applets a second chance.
For the many JSF developers who were present, Roman creates a visual web sample app that uses JMaki and Ajax. He drops a Yahoo map widget, a Google map widget, and a Dojo geocoordinate component from the palette onto the design canvas, and runs the app. In the web browser, both map widgets update in response to input to the geocoordinate widget - and we haven't even written a single line of code yet. The code snippets immediately work together because they use the same standards. Then Roman creates a similar sample application that accesses a Derby database, with a nice-looking Yahoo DataTable control integrated into the UI.
The third example of a RIA is the GWT mail app. Click the About link at the top-right to see a RIA-style dialog. The GWT (Google Web Toolkit) is very handy for Java developers who need to create these kinds of Ajax applications, but don't know Javascript well enough. So you write your stuff in Java (with JDK6), and GWT converts it into equivalent HTML+JavaScript. Neat! There's also a NetBeans plugin for the GWT, check it out.
One question from the audience was, whether there was a GUI Builder for GWT? Not yet, but you can join a community project dedicated to fix that.
Many wonder where the new JavaFX will come in - yes, it is the perfect fit for Java-based RIAs: You can use existing Java code for the back-end, and add declarative JavaFX script for the GUI, the effects and animations. To get a first impression of JavaFX, install the JavaFX plugin and sample (using the NB6 plugin manager from the tools menu). Then create a new project and select the JFX Weather sample, or the JFX 2D tutorial: Click the preview button (an eye icon) and then change the code in the editor. You will see live changes in the editor's preview area.
Question from the audience: So, is JavaFX for designers or for developers? Roman explains that there will be tools for designers to create the UIs in declarative JFX script, while the developer writes the back-end in Java. Since both are basically Java, you save time otherwise spent with integration. Keep an eye on JavaFX, especially if you are considering to mix different unrelated technologies in your RIA project, or if you are about to invest a lot of money in expensive web animation tools.
Stay tuned, more NetBeans Day reports (and pics) are coming...
Posted by seapegasus ( Dec 06 2007, 05:18:40 PM CET ) Permalink