Why should a ColdFusion Developer care about Flex 2.0

In my previous post, I made the comment that we'll be doing more Flex 2.0 stuff and less cfforms. It seems that it was a shock for some people. I was going to respond in a comment there, but I realized that it was better to make a new post on that.

Ok, don't panic, guys :) we will be making a smooth transition from cfform to Flex. Flex will ship next summer so we have a lot of time. Also, we are thinking about opening a cfform and Flex forum here at asfusion because we can not handle the amount of email that we get everyday and I believe that the forum will help making the communication better (Quick poll here: what do you think about that?)


In my previous post, I made the comment that we'll be doing more Flex 2.0 stuff and less cfforms. It seems that it was a shock for some people. I was going to respond in a comment there, but I realized that it was better to make a new post on that.

Ok, don't panic, guys :) we will be making a smooth transition from cfform to Flex. Flex will ship next summer so we have a lot of time. Also, we are thinking about opening a cfform and Flex forum here at asfusion because we can not handle the amount of email that we get everyday and I believe that the forum will help making the communication better (Quick poll here: what do you think about that?)

Going back to the topic of Flex, these are some of the reasons why I think that if you are a ColdFusion developer you may want to take a look at what Flex 2.0 is capable of. I will also outline what I believe the Flex-ColdFusion relation will be.

1. Less expensive than Flex 1.5. For less than $1,000, you have an IDE (a very good one in fact) that will compile an swf with all the framework components ready to be uploaded to any server.

2. No more Flex server. You can deploy your swf to any hosting company. You don't need to spend in a server product that only compiles a GUI. There will be another server product, but it will be optional and adds more data connectivity like push, pull, and real-time communication

3. ActionScript 3.0 has lot of beautiful improvements

  • It is a strictly typed language
  • Has runtime exceptions
  • Includes Regular Expressions and EX4
  • It's 100% ECMA compatible
  • Has a better hierarchical chain. No more MovieClip dependency. No more timelines
  • improved OOP language approach
  • and more

4. The player 8.5

  • It's more robust. They wrote a new virtual machine from the ground up. Now the player has 2 virtual machines and its size has only increased by 100k.
  • Faster, faster, faster. It's amazing how fast the new player is, sometimes 10 times faster than the previous version.
  • New bytecode, more optimized
  • Now the classes are based on traits. This makes it possible to instantiate more objects and consume less resources because the virtual machine knows from which class each object is.
  • New garbage collector
  • JIT (Just in time) Compiled Code (around 10x performance improvement)

5. ColdFusion has everything to start developing with Flex (as opposed as other language such as PHP)

  • A new version of Remoting is available, Remoting 3.0, that will make the AMF packages smaller and it will fix a lot of problems.
  • The ColdFusion Adapter is available now to download. It provides the next Remoting generation.
  • Integration of ColdFusion with the DataServices in the future, (it’s not in the alpha yet) but it will open amazing opportunities

6. The syntax of mxml is very similar to cfform, if you understand how an HBox, VBox, Panel, Alert work, you will find that Flex has almost the same names. Events like click, change, etc are also similar to those in cfform.

7. Framework:

  • A robust OO framework that is ready to use with more than 40 components available. Comparing Flex with cffrom, Flex has a lot more to offer.
  • Easy component development. If you ever had to build your own component you know how time-consuming it is. I used to build my complete set of components in Flash MX (version 6) and I can guarantee you that it’s a long and difficult task. Now Flex 2 simplifies this process a lot.
  • No more mixing or strange practices that insert properties to your class on the fly, breaking the encapsulation paradigm. Now the event model is built-in in the player. Add and remove listeners are cleaner methods because you don't need to pass references to the calling object (this). No more delegates when adding a new listener.
  • Very extensible: you can create your own components and organize your application in different files. As an example, you can separate your views from the model. That kind of flexibility is not possible in a cfform.
  • Separation of the styles from the code. Ability to create and load external style sheets
  • States: It's a new way to organize your components or views. For example, you can have a component with two states, one it's shown when the user is logged in and the other when the user is not logged in. The states are amazing; they give you more flexibility in the development of your app.

8. Flex 2.0 Builder IDE

  • It is built on top of the Eclipse IDE. If you never used Eclipse before, it may be a little hard in the beginning, but once you feel comfortable, you’ll never go back. Bye bye DreamWeaver. Macromedia is also supporting CFEclipse so you can develop your complete application in only one editor.
  • Has a great debugger. You can step into your code and inspect all your properties right there. Add and remove break points makes it easy to track specific problems. That's is very important because I think one of the most frequent question that we receive is how to debug a cfform, what tools to use, etc.
  • Has a Design view that makes it easy to create your layout, you can drag and drop your components and position them to build your app. But if you are a hardcore, you can omit the Design view and make it all by hand ;)

OK everything is good but what will you miss?
You will miss the ability to create a query on your cfm file and use it in a cfgrid or dropDown later on the code.
You will miss Dreamweaver o Homesite if any of them is your editor of choice. You can continue coding on them for your cf development, but you’ll need to use Eclipse for your mxml development, unless you use the compiler directly.
BTW, we added a new pool asking for your CF editor of choice :)

In the near future, we'll be making cfforms for small things and Flex applications if the project is big. One doesn't replace the other. If I need a form for a website, I’ll always use the easy way, that is using a cfform. But if I need a whole application, the easiest way is to do it with Flex. Now that Flex is affordable, why not use it?

Well, to end this long post, I want to say that Flex will have a strong position on the Web 2.0. I think that with this framework, we have the tools to make the web a little better. Not long time ago, making a Rich Internet Application was a big task. Usually, you had to build everything from scratch, there was no framework to support your development, no layout manager to position your components, no debugging tools available, only trace() for all you debugging. Now everybody is talking about Ajax and saying that is the new wave, but it has the same problems that Flash had a few years ago. Flash and Flex have fixed a lot of these problems.

A good debugging environment, a good Framework, good Documentation, good layout managers and good performance are the foundations of building any application, either in the desktop or in the browser. Now the line between the browser and the desktop is blurred. And because of that, there is a man in the dark lands of Mordor that wants all the power. He's making the Avalon-Sparkle ring to rule all the other rings. I hope that the little Frodo (MacroDobe) can make his journey and destroy the ring. Otherwise, expect more Avalon and Sparkle posts here ;)