Oct 2 2006

Flex and Ajax: Man, Flex rocks.

Posted by Joe Rinehart at 10:39 AM
5 comments
- Categories: Flex and ColdFusion

I travelled last week, and I spent most of my evenings and this weekend getting up to speed on Flex. Cairngorm makes a great deal of sense, and the need for it became obvious as soon as I started an app of any fair size. Heck, I'd use it for "Hello World."

Anyhow, I've also spend a good deal of time over the past year doing Ajax applications. I've done them by hand with div replacement, by hand with DOM manipulation, with Prototype/Scriptaculous, Dojo, and Spry. And, wow, do I really just prefer Flex for doing applications

Here's a few quick reasons that I'm really digging Flex:

Vector Graphics

I had an application where it'd make a lot more sense to show some aggregate data in a pie chart. It took less than a minute to add the chart. A minute of binding a slider in a view to a property of that view's value object...and suddenly changes to a number of small views changed the chart in real time. I don't know if that'd even be possible in Javascript.

File Uploads

Without some serious hacks, it's nigh impossible to upload files via Ajax. In Flex, it's a no-brainer, and you can even show progres indicators. Rock on.

Need a control? Draw it.

I used to do a lot of Flash MX / Flash Remoting work, back in the AS1 days. I had an opportunity to do a little control prototyping last week, and I forgot how much fun it was. Now, with Flex, I can implement custom controls (down to the pixel!) in Flash, and then use them in Flex. Sweet.

Remoting

Going over AMF is nice. Going over AMF and having marshalling between AS classes and CFCs is even nicer.

It just works.

A SWF is a SWF is a SWF. Not much, if any, browser inconsistency.

Comments

Peter Bell

Peter Bell wrote on 10/02/06 11:12 AM

Hi Joe,

Really nice post. So, are there any places you feel you'd still use Spry or another AJAX framework over Flex?

Best Wishes,
Peter
Scott Stroz

Scott Stroz wrote on 10/02/06 12:47 PM

I could not agree with you more. Flex kicks the sh*t out of AJAX any day of the week, and twice on Sundays.
Rob Gonda

Rob Gonda wrote on 10/02/06 12:48 PM

Peter, Joe made a good point of styling the word applications in bold. Flex is for building applications, whereas Ajax is more for enhancing web sites. Ajax makes sense for enforcing server side form validation in real time, live searches, auto completes, and many other lightweight widgets that you can drop on existing html sites. Flex is a different beast, and should not be used for web sites.
Joe Rinehart

Joe Rinehart wrote on 10/02/06 2:51 PM

...I can't say it any better than Rob.
Bruce Phillips

Bruce Phillips wrote on 10/02/06 4:49 PM

Rob - Can you give some examples of when you would use Flex and when you would still use Ajax. I'm not talking about retrofitting existing web pages or a web applications, but starting from scratch.

If I'm going to create an a conference registration web application, I believe I'd want to use Flex as my front end instead of Ajax.

I guess I don't understand your sentence "Flex is a different beast, and should not be used for web sites."

Bruce

Write your comment



(it will not be displayed)