RollOut: Adobe's Flex 2.0

Flex uses the ubiquity of the Flash player to make development accessible and resolve incompatibility with older browsers.

September 8, 2006

5 Min Read
NetworkComputing logo in a gray background | NetworkComputing

AJAX development is difficult even under the best of conditions: Browsers implement the DOM (Document Object Model) in different ways. XML is an open-ended construct that can be hard to manipulate. No browser renders Cascading Style Sheets in perfect W3C compliance. JavaScript still has flaws. All this can make Ajax development--especially without the benefit of frameworks or toolkits--the sole domain of the IT guru. But with its release of Flex 2.0, Adobe simplifies matters and allows for the rapid design, creation and deployment of rich Internet apps.Technically, Flex 2.0 isn't a true Ajax framework because JavaScript is not executed within the browser. Rather, Flex 2.0 executes ActionScript, an ECMAScript-compliant language, within the browser-hosted Flash player--in other words, the app created by Flex 2.0 is a Flash object. This provides benefits compared with the usual Ajax architecture. The strong multimedia capabilities built into the Flash player, for example, mean applications created with Flex 2.0 can access audio and video resources on the client in a more mature way than can be done with JavaScript.

The free Flex 2.0 SDK provides a component library, documentation, and a command-line compiler for building rich Internet applications ready for unlimited, and royalty-free, deployment. This SDK can be integrated with various code editors, including Visual Studio and Eclipse. To simplify matters, Adobe's $499 version of Flex Builder 2.0 includes an editor based on the Eclipse IDE.

DEVELOPMENT TO THE MAX

Flex apps use Adobe's MXML (Macromedia Flex Markup Language) to create components, define actions, handle events, display data and interact with the server. We found that many components could be used as-is, simply by adding them to a form using standard RAD techniques. We could then set properties for components and define actions based on certain events. The resulting MXML, and supporting ActionScript code, was then compiled into bytecode and executed by the Flash player.

Click to enlarge in another window

Using straightforward MXML declarations and ActionScript code, we quickly displayed lists of customers and, when we clicked on a particular name, details about that customer's order. Competing Ajax frameworks, such as Dojo and Yahoo's User Interface Library, require you to include references to JavaScript libraries that define component behavior. These libraries do provide rich functionality in a procedural way, but we found Flex's declarative MXML syntax required less overall coding to accomplish the same task. Google's Web Toolkit takes a slightly different approach, letting the developer code in Java using Google's user interface components, which are then compiled into JavaScript and executed on the client. Like Flex, this allows for a more RAD-based development technique (see the table at left, for a comparison).

A problem all creators of rich Internet apps wrestle with is what to do when an older browser is encountered. Many apps attempt to degrade gracefully, that is, work with as much functionality as possible, for as long as possible. Using Flash as its base lends Flex a distinct advantage here: Flash has been around for a very long time and is supported on most browsers, even those considered obsolete. Flash is also less dependent on the browser version than JavaScript. As long as a Flash player is available for the browser in question, the app will execute as designed. Other frameworks that rely on JavaScript for their client-side actions are less flexible in this regard.

Flex 2.0 supports SOAP Web services for data retrieval and manipulation. In addition, enterprises can purchase the Flex Data Services toolkit, JavaEE-compliant software that, when combined with a Flex client app, provides additional data services, including real-time data feeds, messaging and direct calls to Java objects. This is a level of integration not found in other Ajax frameworks.

Pete Payne is a software programming consultant with a nationwide consulting firm. Write to him at [email protected]. 0

SUBSCRIBE TO OUR NEWSLETTER
Stay informed! Sign up to get expert advice and insight delivered direct to your inbox

You May Also Like


More Insights