07 May 2007

Flex Coldfusion Integration - don't follow Adobe!

So... I've had a bit of free time at work to brush up on Flex, specifically Flex and Coldfusion integration.

I've been doing Flash remoting with Coldfusion Flash forms, which were really Flex 1.5. for the last 18 months. I followed the CFC structures as described on www.asfusion.com and ray.camdenfamily.com: store your CFC's in the Application scope and access them with a lightweight proxy CFC that handles the remoting. This structure improves performance, as the proxy CFC is instantiated on each request and it acts as an interface to the bulky CFC's that do all the complicated stuff. From Flex's point of view, this proxy CFC acts just like any other web service on any platform.

So I've been confused by Adobe's instructions for Flex / Coldfusion integration. They suggest you create Actionscript equivalents of your CFC's and essentially map the properties and methods of the CFC into Actionscript. This has the benefit of accessing CFC's as if they were native classes and there'd be no problem with handling data types - essentially extending Flex with Coldfusion.

However, my new job is in Calgary, Canada, where PHP reigns and Coldfusion is a rarity, hardly anyone uses it. So why would I create a Flex app which is so intertwined with Coldfusion? Even if I was in a Coldfusion centric environment, I still wouldn't build this way as I may need to port the Flex application to another Platform. I could quickly convert the CFC's to PHP classes and have no need to change the Flex application at all.

The reason I rant, is that I've been following Flex tutorials which have been confusing and going against what I thought was "right". I think I'll just stick with tips from AS Fusion and Ray Camden from now on!

No comments: