
2008 is going to be an important year for Rich Internet Applications. Most organizations are delivering or planning to deliver Rich Internet Applications; however, at the same time, most IT managers are facing a dilemma: which Rich Internet Application technology and platform to use? The number of different frameworks and libraries is too vast to even consider evaluating a fraction of them.
To make this task manageable, to narrow things down to three different technologies for delivering enterprise-level Rich Internet Applications. While the first two (JSF and Flex) are proven technologies that have been used for a numbers of years, JavaFX is a new declarative language for building rich user interfaces using Java.
Flex:
The one for delivering Rich Internet Applications is the high-performance Flash
player from Adobe. Flash player (version 9) is a ubiquitous lightweight virtual
machine that's installed as a plug-in inside a browser and runs Flex applications.
Flex provides a declarative language called MXML that offers out-of-the-box graphical UI components as well as ActionScript, an object-oriented programming language, to build advanced user interfaces. Compiled Flex applications run inside the Flash virtual machine to enable a much richer user experience than would be possible in a standard Web browser where the markup (HTML) and JavaScript are interpreted. Flex is easily extendable and provides easy integration with back-end technologies such as Java, PHP, and ASP.
Let's look at the demo application using Flex. Flex provides a declarative
way of defining the UI. The compiled file then runs inside the Flash player
installed as plug-in inside a Web browser. Here's how the application could
be declared:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx=http://www.adobe.com/2006/mxml layout="absolute">
<mx:Script>
<![CDATA[
[Bindable]
private var numOfClicks:Number = 0;
public function click():void{numOfClicks++;
}
]]>
</mx:Script>
<mx:Panel x="10" y="10" width="250" height="114"
layout="absolute" title="Flex">
<mx:Button label="Hit Me" click="click()" y="10"
horizontalCenter="0"/>
<mx:Label text="Number of hits: {numOfClicks}" y="40"
horizontalCenter="0"/>
</mx:Panel>
</mx:Application>
The model for the UI is defined inside the mx:Script element.