Wednesday, November 21, 2007

How Nicely Decoupled a Web Client Flex Is

Flex got to be the most decoupled web client I have ever worked with!

Back half a year ago, I blogged about choosing a RIA framework, which I found hard. At that time, we ended up with Flex2 as our choice, and the next couple of months it would have to prove its value. And I most certainly must say that it has! I just wanted to share what our experience have been so far.

Editing and Building
It has proved to be real nice to work with. We are simply using the free SDK, combined with the maven israfil plugin for building and IDEA for editing. With IDEA7, there is pretty good JavaScript (and hereby ActionScript) support combined with some (not much, yet) Flex support.

Flex Framework
The framework itself has shown to be powerful enough for our needs, and I suspect it also will be for the needs of most people. There are quite a few UI components available, including a powerful DataGrid. And the upcoming Flex3 will have even more. Also, the extension possibilities have proved to be good.

The documentation is quite good, and where it lacks or in situations of bugs in the framework, it has come in handy to have the open source code at hand. Sadly, not all of it is open. Missing are stuff like the remote stack (web service calls) and of course all in the flash.* packages.

And there are already flex/as3 component libraries out there, like flexlib on google code and a bunch here, linked to from riaforge.

Sooo Decoupled
Propably, the thing that have stricken me the most about working with flex (or flash) as a platform for applications on the net, has been how decoupled from the server development it can be. And I find that a good thing.

As an example, take the whole build, assemble, deploy and test cycle.

With a technology stack where the web front is using a server-side html/js generation framework, you most often build, assemble and deploy that together with all of the other parts and layers of the application. First then, you test.

With flex, you can compile and try out the UI web front completely by itself. When I work on UI related stuff, I simply compile the flex part and launch the standalone player to try it out. That is a 15 sec. build cycle at most. At the same time, I have my web services up and running in the back all the time, so the standalone player is actually playing up against the server side, as it will be when the flash is being served from a web application to a browser.

At the time where we chose flex, we had an open issue on how to test it. I regret to say, that this is still an open issue :-( The best bet right now seems to be flexunit, but we have postponed it a bit, as it seems hard to integrate nicely into a headless, continuous integration build. For a short while I thought I was going to use funfx and write my tests in Ruby, but that was only until I found out it required a FDS license.

Bottom Line
Bottom line is, that it is simply nice to work with, and I am loving it!


James Ward said...

I have really enjoyed reading your blogs about Flex. Thanks! You should get your blog aggregated on MXNA.


Per Olesen said...

Hi Jim. I am always glad to hear when someone likes my posts.

I didn't know MXNA. Thanks for the hint. I have submitted my feed.