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
Network Computing logo

The Upshot


Adobe Flex 2.0 simplifies development and deployment of rich Internet applications by providing a large number of prebuilt, browser-agnostic components for interface design, data display and manipulation, and audio and video output. In addition, the ActionScript language provides procedural control of the application when declarative MXML won't do. Finally, Adobe Flex applications are, at their core, Flash applications, and therefore supported on the vast majority of browsers.

Ajax (Asynchronous JavaScript and XML) is all the buzz in enterprises. To some, it promises the best of thick-client desktop applications combined with thin-client Web pages. To others, it's yet another in a long line of hyped technologies that don't live up to their billing. The truth, as always, is somewhere in between. Ajax, when done well, does combine the best of the desktop and the Web. The client handles interface tasks, letting users keep working, while the server performs much of the heavy lifting, crunching data and returning results. The problem is, coding Ajax is, well, hard.



Adobe has taken a different tack from other vendors regarding browser support, relying on the ubiquity of the Flash player to power its Ajax offering on the client. By making the core SDK freely available, it stays aligned with competing vendors (Google, Yahoo, Microsoft) that provide free toolsets as well as the open-source community (Dojo, Rico, Zimbra's Kabuki). In addition, Flash is perceived as being more secure than client-side scripting. However, there's no getting around the fact that using Flex locks you into Flash player, a constraint some may find unpalatable.


Adobe Flex 2.0

www.adobe.com

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
More Insights