Building RIAs : Flex 2

For the second part of my series on the solutions behind Rich Internet Applications, I am covering Flex 2, just released by at the end of June along with a new version of their ubiquitous Flash Player. In the first part, I covered Laszlo Systems' OpenLaszlo.

For the second part of my series on the solutions behind Rich Internet Applications, I am covering Flex 2, just released by Adobe at the end of June with a new version of their ubiquitous Flash Player. In the first part, I covered Laszlo Systems' OpenLaszlo.

History of Flex

Flex 2 is actually the third iteration of the Flex product line. Flex 1.0 was released in 2004 almost under the radar. Later that year, Adobe released Flex 1.5 which was the first major release for the product. It also came with a gigantic price tag of $15,000 per CPU which limited its adoption to enterprise-level companies and some universities. It gained some traction however, and proved to be a solid solution for building internet applications. With Flex 2, Adobe got more ambitious and wanted to vastly expand the adoption. They also wanted to address some of the issues with Flex 1.5 including performance and scalability. Rewriting the Flash virtual machine almost from scratch vastly improved the performance of Flex applications and Adobe's push to bring the platform to independent developers seems set to pay off.

Overview of Flex 2


Get Started with Flex 2:
Cost: Free (Flex Builder is $499)
Language: MXML
IDE: Flex Builder
Killer App: Many
The Flex 2 framework is part of what Adobe has branded the Flash Platform, which encompasses the Flash Player, the Flash authoring tool, Flash Lite, and Flex among other technologies. Flex is meant to be a developer entry point into the platform. While it would be entirely possible to write a Flash application in ActionScript, Flex 2 provides a more developer-friendly way to build these applications.

Flex 2 uses an XML-based language, MXML, as its declarative language. MXML is very component based, but these components can be expanded and enhanced via ActionScript. In fact while it is possible to build an application entirely in MXML, most applications, and all of the sophisticated ones, will use a mixture of MXML and ActionScript 3.

Flex 2 comes in a few different forms. The Flex SDK, which contains the core code, is free and can be downloaded from Adobe and used to build Flex applications using any text editor. The source code for the Flex framework is also available, part of Adobe's move to woo the open source community. Flex Builder, which is an Eclipse-based IDE, costs $499 and provides all of the trappings of other IDEs including code hinting, syntax highlighting and debugging. There is also a design view that will help people new to Flex get started and easily lay out the basics of their applications. The charting components of Flex 2 are sold separately and enable the charting and graphing features of Flex 2. The final piece is Flex Data Services (FDS), which could be an entirely separate post and allows for messaging between applications. This is a server product, much like Flex 1.5 but provides for developers looking to build collaboration applications or those requiring real-time-data. There is an "express" version that allows for unlimited users on a single CPU but the full version starts at $6,000 and goes up to $20,000 for the enterprise level solution. FDS integrates very tightly with the J2EE architecture which means that FDS will allow for more secure, feature-rich, and powerful applications. There are a lot of business cases for FDS and I hope to explore those in the months ahead. I can't do it justice here.


Flex 2 Versus the Other Solutions

Flex 2 applications are simply Flash applications, which means that anyone with Flash can run them. While OpenLaszlo uses Flash Player 7, Flex 2 requires Flash Player 9 meaning there will be some lag in the number of computers that support Flex applications versus those that support OpenLaszlo. However one of the strengths of Flex 2 is that it works seamlessly with ActionScript 3, the next generation of ActionScript which has matured and is now aiming for full ECMA script compliance. More seasoned developers will feel at home in the ActionScript 3 environment. OpenLaszlo is probably the best solution out there for smaller development teams because it's very easy to get started, but it lacks the complete solution that Flex 2 provides. I see smaller development shops getting into OpenLaszlo and then some of them jumping over to Flex 2 when they outgrow what OpenLaszlo can do.

Comparing Windows Presentation Foundation (WPF) and Flex 2 is somewhat misleading because while WPF will be used to create some amazing RIAs, it is primarily going to be used to build desktop applications that can be delivered over the internet. Comparing WPF to Apollo, which I will do in later posts, is a much more pertinent comparison. For now, Flex 2 and WPF simply aren't competing in the same space, though I expect that to change as the platforms mature.

Flex 2 In the Wild


Adobe was very open during the development of Flex 2 and released public versions of alphas and betas on their google-esque Labs site. As a result, companies and individuals were able to jump into Flex and create some great applications before the product was released. Adobe even hosted a developer derby which brought in a ton of entries and some good examples of Flex in action. One of my favorites was the SQL Admin written by Kevin Kazmierczak. (See the entries in the Flex 2 Showcase Gallery). Flex 2 has already seen some adoption in the corporate world as well as can be seen on the customer list.

The Future of Flex 2

When Flex 2 was released, I wrote that no one noticed, and that is still true. I agree with one of my commenters on that post that Flex 2 is a product which won't really come of age until a few months down the road. Right now, if you are planning to build RIAs, Flex 2 is the best solution on the market. But people are still figuring out what an RIA should be, and Flex 2 will experience those growing pains. As Flex 2 matures, and people start to see what's possible, there will be a tremendous amount of growth. People will tell you that Flex and Ajax don't compete - but they do, and the explosion of Ajax has shown that people like building rich web applications. At some point, the best Ajax developers will hit a wall and have to find other ways to bring their visions to life. Flex 2 is a very compelling technology for those people, and I think Adobe will begin to see a lot of Ajax developers embracing Flex. By the time Microsoft releases WPF, we'll see a lot of high quality developers building RIAs and it will make for a wide and diverse market.