Macromedia Flex is a brand new server product, one that is poised to forever change the way we coders think about building rich and engaging user interfaces.
Yes, I did say "server." No, Flex does not compete with ColdFusion. Yes, Flex and ColdFusion are designed to work together.
Having now dispensed with the obligatory preliminaries, I'd like to present Macromedia Flex to the ColdFusion audience from a distinctly ColdFusion angle. And so this month I will:
- Explain exactly what Flex is, from a ColdFusion user's perspective.
- Discuss the ColdFusion/Flex relationship.
The best way to understand Flex is to think about how you build Web applications right now. If you are a ColdFusion developer (or a developer who uses ASP, JSP, PHP, and the like) you probably build applications comprised of lots of linked pages. These pages contain client code (at a minimum, HTML and JavaScript) as well as server-side code (CFML, SQL, and so forth). You probably try to separate content (or back-end data) from presentation (the front-end UI), but you still use both to create your application.
So, in the case of a ColdFusion page, a browser requests a CFML file, ColdFusion parses and processes the CFML in that file, and then returns client code to the browser. The browser renders the client code on the client, but it is ColdFusion on the server that embeds that client code in the page. Put differently, ColdFusion is a server that dynamically generates client-side code.
So why all this analysis? Simply put, Flex works in much the same way. Whereas ColdFusion (despite being somewhat client independent and agnostic) generates client-side HTML, Flex generates client-side Macromedia Flash SWF files. Perhaps that's a bit too simplistic, but the analogy is sound: ColdFusion uses plain text files containing CFML tags to render browser content, and Flex uses text files containing MXML tags to render Macromedia Flash content. Compare the flows of both processes in Figures 1 and 2.
But that is where the similarities end. Unlike ColdFusion, Flex and its language, MXML, do not provide tags for database integration, sending and receiving e-mail, connecting to LDAP servers, or creating Web services. Whereas ColdFusion is more of an all-purpose application development platform, Flex has a far more focused objective and a very specific goal. Flex is designed to facilitate the creation of rich and engaging presentation layers, letting developers create well designed and optimally architected n-tier applications that adhere to standards and best practices. With Flex, coders can take advantage of the ubiquitous Flash platform from a very code-centric starting point, but what Flex generates is still Flash content. In other words, Flex is all about presentation and user interaction, and that's it.
Flex is actually similar to ColdFusion in one other way. Flex, like ColdFusion, is a Java application. Flex is deployed on top of standard J2EE servers, such as Macromedia JRun, IBM WebSphere, and so forth, in much the same way that you deploy ColdFusion, but more on that soon.






