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!




http://direct.adobe.com/v?xJlPJvvEcvPPPWHvJ
Also no rediculous Holly Hacks or other garbage! HTML+Ajax is Dead, Long Live Flex!
DW
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
Having never done any actionscript, i'm struggling slightly, but every day seems to bring a moment of relevation....
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.
One useful link:
Flex Explorer: http://examples.adobe.com/flex2/inproduct/sdk/expl...
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.
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.