7 articles and counting

How Adobe Flex won me over AJAX

I will admit my opinion is a little late  in regard to the  battle over Flex vs. AJAX debate but I thought my experience may be helpful to other developers who may face the same dilemma.

First, I will  still use AJAX when I develop VB.NET web applications because I think it offers  nice enhancements like no full page post backs and other general UI enhancements. So when I was needing a tool to do graphics manipulation my first thought was to look for an AJAX solution like jQueryUI . I played with it for awhile and figured it could do the job. However, my boss loves Flash and he suggested I look into using Flash, which I had no real development experience other than playing with it for few hours back with Flash 4 some time ago. Now I am not a big anti-propriety solutions guy,  but I did come from a background of hand-coding CSS-designed sites which inevitably  led me to read sites that were big on standards and openness.  I was definitely hesitant to the say the least, because I believed Flash was best for videos and cool interfaces, but not serious application development. But then I met Flex, and that changed everything.

I like to describe Flex simply as a framework  built for developing web applications, while Flash is for building interactive content. With that out of the way, I would like to list my reasons why I chose to use Flex over AJAX.

  1. Data persistence or viewstates . In general, I do not have to be concerned at all with postbacks or page refreshes in regard to variables and objects. I can create an object, assign it a value, and basically set in the corner so to speak until I need to use it later.  While building  a web application to be used with Oracle EBS last year,  I ran into AJAX issues in regard to viewstate and my boss would say that you just don’t have to worry about that stuff in Flash. Now I know why.
  2. Browser compatibility issues no more! Anyone doing CSS-based web design knows about browser compatibility issues. Gone are the days of being concerned about layouts looking the same  in disparate browsers, whatever you design in Flex is how it will display across all browsers. I can give a textbox component an X,Y coordinate and not have to worry about floats, positioning, clearing divs, etc.  This gives me more time to focus on the development of the application and less on presentation.
  3. Powerful Graphics API. This was a big deal for my project as I need to move objects around on the screen and resize them  among other things. This comes very natural in Flex in the drawing classes. With just a small bit a code I can even draw objects on the screen like in Photoshop and Illustrator.
  4. Webservices Support. Obviously AJAX wouldn’t be AJAX without xmhttprequest. However, I can communicate directly to a WSDL on another server, ( although there can be some issues with crossdomain files, which I have not had issues with yet.) This can’t be done without first interacting with a scripting language like PHP, ASP.NET, etc. In Flex Builder 3 they even provide a nice tool that will perform introspection over your webservice and create all the necessary classes for you. It is a very helpful tool if you don’t need to customize the webservice functionality.

So those are some of the main reasons I chose Flex over AJAX. I still believe AJAX has its place but I  plan on focusing more of my development in Flex in the near future.

Leave a Reply

Name (required)
Mail (will not be published) (required)

Your Comments:

Spam Protection by WP-SpamFree