Adobe Flex Part 1: Initial Impressions of Learning Flex

I've spent the last several weeks really immersing myself in learning Flex in preparation for some upcoming projects. I'll be blogging about this learning process as it goes on, but to start with I wanted to give some initial impressions.

First off, working with Flex is a joy compared to working with AJAX. Sorry AJAX lovers, there is just no comparison. Even with Aptana and jQuery/EXT/insert JS framework here, building any kind of complex AJAX app is an utter pain in the ass. My favorite is when you make a change and the whole thing just stops working, with no indication of why. If you're lucky, Aptana or Firebug will flag a missing semicolon. If not, then start wading through line by line adding debug statements, and kiss your day goodbye.

Not so with FlexBuilder. This IDE just rocks. I've dabbled in Java for years, so I've seen what a good Java IDE like Eclipse can do. FlexBuilder works the same way. The instant code insight is such a refreshing change, the automatic imports, the flagged errors, the debugging, and the refactoring tools all work together to make Flex development feel quite effortless. Seeing FlexBuilder makes the old anger at Adobe's lack of a great IDE for ColdFusion come rising up again. I wish they'd put that kind of effort into CFEclipse. I love CFEclipse and salute Mark Drew for making it what it is, but it could be so much more if Adobe would really put effort into it. In my opinion they just have no excuse for this.

But I digress, this isn't supposed to be a "Pine for Killer CF IDE" blog entry. The other thing I love about Flex is that a "design-challenged" person like me (to put it mildly) can make things that actually look halfway decent with very little effort, just using the default look and feel. And if you do put some time into styling things, you can make some great looking UI's.

I do have to say that learning Flex, ActionScript, and Cairngorm all at once is a pretty duanting set of things to take on. The Flex API is quite huge, ActionScript is an entire language unto itself, and Cairngorm...well don't get me started on Cairngorm since it is truly a beast when you first look at it. I'll be blogging about Cairngorm and my experiences in absorbing it as well.

My approach so far has been to take my trusty bookstore application (the one that has gone through Fusebox 3, FuseQ, Fusebox 4, Fusebox 5, Model-Glue, Mach-II, Reactor, and ColdSpring versions) and port this to Flex. I've deliberately NOT done this port in a "best practices way". Instead, I've created a giant mess of a main MXML file, with virtually all the event handlers, remote object calls, and UI elements stuffed into one big file. I did this on purpose. First, I just wanted to get it working in a "brute force" kind of way to see how things are done in Flex. Now that this is done, I can clearly see where the problems are and what a maintenance nightmare it would be. To put it another way, I needed to see where some of the pain points are when doing Flex development.

I'm now refactoring the whole thing and migrating it to Cairngorm. This way, as I break things up and move things into line with that framework, I can more easily see the benefits of why it does things the way it does. As I said, I'll be blogging about this process, and I plan to add my initial "Chaos Framework" version as well as the Cairngorm version of the bookstore to the zip file in the sidebar when it is done.

I'll also put together a list of links and resources that I am finding helpful in my learning. I'm interested to hear from anyone who is learning Flex, or who has already learned it and has any advice, tips or pointers. I'm also interested in hearing from anyone who hasn't made the jump to Flex or who just doesn't want to learn it. I know that Flex isn't meant to replace traditional web pages, but rather is meant to build full blown applications where issues like search engine friendliness are less of an issue. (Though if someone has pointers to techniques for making Flex apps more search engine accessible, I'd love to hear them). Hopefully these blog entries and any reader comments will help others who are tackling Flex make the leap as painlessly as possible!

Related Blog Entries

Comments (Comment Moderation is enabled. Your comment will not appear until approved.)
Free Flex training until '08..
http://direct.adobe.com/v?xJlPJvvEcvPPPWHvJ
# Posted By Adam | 12/10/07 11:52 AM
I agree with each point you made above. I'll also add that Flex is the same across platform. That means no stupid padding errors on IE or wierd float problems to spend hours on.

Also no rediculous Holly Hacks or other garbage! HTML+Ajax is Dead, Long Live Flex!


DW
# Posted By Dan Wilson | 12/10/07 12:26 PM
I've been looking to Flex a bit myself lately, and I will say I think ActionScript 3.0 seems to be a great language for CF'ers who are looking to strengthen their OO knowledge (as I am). Joey Lott has an excellent ActionScript 3.0 training series at Lynda.com which is done in FlexBuilder 2.0 and is a great chance to explore FlexBuilder from a low level, while continuing to drive home many of the object oriented principles many of us have been working to solidify. Of course, mxml writes much of the AS for you, but I have found it helpful to dig right into heart of constructing classes in AS, etc, from the beginning.

You're right though Brian, hats off to Mark Drew -- it would be spectacular to have Adobe kick in some serious support for CFEclipse as a development environment as robust for CF as FlexBuilder 2.0 is for Flex developers.

- Fitz
# Posted By Fitz | 12/10/07 12:45 PM
I'm on the same path - I've been trying Flex for a week now, and am loving it so far; I had a Eureka Moment when I got Flex talking to a CF CFC, meaning I reuse basically all my application code and create a nice shiny front end for it.

Having never done any actionscript, i'm struggling slightly, but every day seems to bring a moment of relevation....
# Posted By Tom K | 12/10/07 12:47 PM
the biggest pain in the rear I've come across with Flex is just figuring out how to compile without a server specific services-config.xml file.
once you get past that (using a generic one that comes with Flex/CF and compiling with a copy of it in your source directory) Flex is relatively easy and fun to deal with.
I've spent ALOT of time with non-coding related issues with Flex.
CODING Flex is pretty quick.
just my two cents.
# Posted By Walt | 12/10/07 1:15 PM
Walt, I haven't run into any issues, I've just been picking "ColdFusion Flash Remoting", pointing at the server (in this case localhost) in the project setup in FlexBuilder 3, and it just works. Is the services.xml file something that isn't needed in FlexBuilder 3? Or have I not run into this because so far I've only been developing on localhost?
# Posted By Brian Kotek | 12/10/07 1:21 PM
I just started working with Flex about 3 months ago now (given a book and was told "Learn this" :) ), and have been loving (almost) every minute of it. I'm sure you've used the debugger in Eclipse before, but it certainly makes most problems pretty simple to troubleshoot (much simpler to figure out what's going on with the data, especially with all of the events that are being fired off, and all asynchronously). There have been times where I've wanted to throw my PC through a window for errors I was receiving only to find that it's something as simple as restarting ColdFusion or just not knowing exactly all the intricacies of actionscript. All in all, it's been an enjoyable experience, and I'm looking forward to more AIR apps and what Adobe has next (hopefully abstract methods and Singleton's will be along soon with AS). Definitely port to AIR if you get the chance as all that it requires (mostly) is change "<mx:Application" to "<mx:WindowedApplication". It shocked me how simple it was :)

One useful link:
Flex Explorer: http://examples.adobe.com/flex2/inproduct/sdk/expl...
# Posted By Gareth | 12/10/07 1:30 PM
What I had come across was, I'd develop something locally, and move it to our dev server. It'd work fine there, but the kink that we came across was moving it to our 'live' server that hosted two domains.
What happens is, if you have two swf's with the same name (as I was doing with a Flex app that did the same thing for both sites) the first SWF to load would cache site specific info and would always load THAT data , even if you went to that other SWF.
Basically, what I found out was, if you just compile with the generic services-config.xml file , instead of changing anything in it, and compiling it from your source folder, you can put that Flex app basically anywhere that your Remote object calls will be able to get to data (I use CFCs myself, and use the same datasource names for development and live)
Anyway, my overall experiences with Flex is absolutely positive once I got past some setup/config issues here and there. I love Flex.
# Posted By Walt | 12/10/07 1:33 PM
I went the route of buying the Total Training DVD and then also working through the Training from the Source - Adobe Flex 2 book which I highly recommend. Coming in with no background the book was great.

One factor developers need to consider when porting/writing an application in Flex is their target market - I know it sounds obvious. For example if you are selling a cart solution and you port it to Flex you limit yourself to developers who can easily adopt your solution and customize/extend it - in other words know Flex.

On the surface Ajax/jQuery/Ext etc. look like a easier option since developers are familair with the technologies. I'm not convinced on that one - as you pointed out debugging ajax can be painful and if you look at RIA like interfaces (the Ext web desktop is really cool) suddenly the code starts to become complex and performance and cross-browser issues are concerns. That means support headaches.

My conclusion is that if a RIA makes sense then Flex is the better choice. Whilst fewer developers (for notw at least) may be able to dive into your code you will probably have fewer support requests. Support should also be easier with the better debugging.
# Posted By Johan | 12/10/07 5:10 PM
BlogCFC was created by Raymond Camden. This blog is running version 5.9.1. Contact Blog Owner