Spring Flex integration with BlazeDS
As I mentioned in an earlier post, I have some architectural reservations about using JSF as a platform for Rich Internet Applications. Flex, on the other hand, has some features which make it an attractive alternative platform for RIAs, namely:
- Client management of UI components (e.g. in-client MVC for UI)
- Flash runtime addresses cross-browser issues of javascript/xhtml/css solutions
- UI builder tools (Flex Builder, IntelliJ, etc.)
Now I realize that point number two may be a con rather than a pro for open source purists. This is a legitimate point. The Flash player is not open source. However, most of the specs surrounding Flash/Flex are in fact open source, including the SWF file format, the AMF protocol (which I use in the example below) and Flex framework itself. Here’s an (unofficial) note from Adobe on the state of the open source and Flash. I’ll leave you to judge for yourself the merits of the justifications outlined there for keeping the runtime closed (e.g. proprietary video codecs).
Another interesting long-view consideration for Flex adoption is Apple’s refusal to support Flash on its mobile devices (iphone, itouch and nascent ipad). This is another legitimate consideration. But, I believe we’ll have to wait and see how this plays out before we allow it to impact the decision to implement a Flex RIA solution. In the near term, if we want to provide a decent experience for Apple’s mobile devices, I think we’re talking about developing native apps for those devices. And as far as considering HTML5 as a suitable replacement for Flash, that’s definitely another long-term consideration which warrants little more than a wait and see approach.
But enough speculation on the merits of Flex and Flash.
The real point of this post is to report on my test of Spring Flex Integration using BlazeDS. I’ve been very loosely following the BlazeDS project for a couple years now. It has attracted me because it offers us JEE type developers the potential and promise of essentially tacking an additional RIA onto our existing enterprise Java back ends.
So, with that in mind, I headed on over to the Flex BlazeDS Integration page at Spring to see if it was really that easy to use BlazeDS to implement a Flex RIA against our Spring managed components.
The short answer (if you don’t want to wade through the code samples below) is yes. I give Spring Flex integration high marks and would definitely consider it for any future RIA solution due to ease of use. If you have existing Spring managed components, especially using annotations based configuration, it’s pretty simple to drop a Flex RIA onto those and let BlazeDS (rather transparently) provide remoting services to the client.