ColdFusion 9: Flex Improvements
With the release of the ColdFusion 9 beta I thought I'd share a few of the Flex integration improvements I've been checking out this week. First, ColdFusion 9 now uses Blaze DS to power Flex remoting and messaging. ColdFusion has had remoting support for several versions, but before CF 9 you had to install LCDS or BlazeDS to get Flex messaging. With the move to Blaze DS there is no longer an integrated LCDS Express installation option, so if you want RTMP or data services you will have to buy a separate LCDS license or install the free LiveCycle Data Services ES Single-CPU License version yourself. I know some people feel this is a loss but I'm pretty happy having messaging available out of the box, without the single CPU limitation.
Another big improvement is that ColdFusion now correctly serializes CFC relationships to AMF. Previously, recursive or repeated object references were not correctly serialized. For example, serializing the the following object graph via CF would result in the child object being null for the father object when received in Flex.
child = createObject("component","child);
family.mother= createObject("component","parent");
family.mother.child = child;
family.father = createObject("component","parent");
family.father.child = child;
return family;
This was a huge issue that made ColdFusion almost unusable for serious OO Flex work. I'm very glad to see this fixed.
Another small enhancement to Flex messaging support is that the CFEventGatewayAdapter now supports selectors for message filtering. So in addition to using subtopics, you can now filter the messages a flex consumer receives based on message header values. For more on message filtering be sure to check out the BlazeDS Developer Guide.
Flex remoting is also reported to be much faster in ColdFusion 9 due to optimizations in the AMF serializing/de-serializing process, although I haven't tested this.
With all the Flex improvements the big thing that is missing from ColdFusion's Flex integration is lazy loading of Hibernate objects. Given how much Adobe is hyping Hibernate ORM support I'm surprised this isn't in ColdFusion 9. It would certainly make a compelling argument for powering your Flex applications with ColdFusion. There are actually a couple of bugs/enhancements logged for this, #76073 and #77738, so if you plan to use the new ORM features with Flex I encourage you to comment or vote on these issues.
Finally, I also ran into one backwards compatibility issue. Previously, when working with the Data Services Messaging Event Gateway the keys to the CFEvent structure passed into the onIncomingMessage event handler were not case sensitive. It seems that in CF 9 the keys in the body of the event are now case sensitive while keys in the event headers are not. I've logged a bug for this, #79712, if you would care to comment or vote.
I'm sure there are a lot of other improvement to ColdFusion 9's Flex integration that I'm missing here so if you know of any, or have any bugs/enhancements you would like to mention, please share.




I voted for #79712 BTW
I compared a LCDS RTMP channel with a BlazeDS long polling channel for a messaging application I did recently and couldn't really tell the difference. We ended up going with BlazeDS and long polling because we didn't have a one CPU server to deploy on. (How does one even get a one CPU server these days?)
Anyway my gut feeling is this: if your messaging application demands RTMP you probably don't want to be running on a one CPU server. If however you were using the data management capabilities of LCDS, then you may want to investigate how to integrate LCDS with ColdFusion.
I'm somewhat disappointed about this but I'll investigate alternative methods and perhaps there is a solution there that will fill our needs.
I've been a ColdFusion developer for about 5 years, and can do a lot of cool stuff with jQuery and alike, but time has come for me to have to write my first Flex app, and I'm hoping you might have a few suggestions.
I'm doing research on if it's even possible for me to do what I need. I'm building an app to manage scores for sporting events, and some things like the leader boards, really need to be refreshing in real time. So as new scores come in, they should immediately be reflected on all leader boards, ideally with some animation or highlight that indicates a score just changed. Now the closest thing I've seen to what I need to do were all those CNN, Fox, CNBC apps during the last presidential elections, where as results were coming in the data was automatically pushed to all the connected clients. I don't even know how that works conceptually, is it the server somehow pushing the data to the Flex clients? Cause I don't want every Flex client to have to keep hitting the server every couple of seconds querying for changes like a web page would have to.
Do I even need to use Flex to do this? Can LiveCycle be used with just JavaScript/ColdFusion somehow to do this.
Any help, suggestions, examples are highly appreciated.
Thanks,
-Roman
It seems that the bugs you mention:
http://cfbugs.adobe.com/cfbugreport/flexbugui/cfbu...
http://cfbugs.adobe.com/cfbugreport/flexbugui/cfbu...
Has been closed by Adobe without any response/workaround... Do you have any update to give on that ?
In my point of view those bug still apply in the current version.
This one, regarding CF9 Lazy loading is still open... but no news from adobe ! It's an important Hibernate features and make the use of relations almost impossible to use:
http://cfbugs.adobe.com/cfbugreport/flexbugui/cfbu...
Thanks
Simon
As for Hibernate features, I hope they will be able to do more here but I have a feeling that there may be some conflict with LCDS, which does support Hibernate.
Thanks for you replies.
I, like many other CF developer don't want to go to LCDS for many reasons. So I hope Adobe are going to improve Hibernate on Coldfusion and not try to push the use of other, more complex solutions.
Maybe you could help me on this problem:
I still have an issue when trying to send an object back to CF - HB ORM. This error message occur when I use entitysave:
"[RPC Fault faultString="Error deserializing client message." faultCode="Client.Packet.Encoding" faultDetail="null"]"
The error doesn't occur (and my user object get persisted in the database) if I delete his many-to-one realtion:
<cfproperty name="group" fieldtype="many-to-one" cfc="group" fkcolumn="group_id" fetch="join" remotingfetch="true" >
But of course I want to keep it !
I don't think it's related to a Coldfusion 9 Hotfix...
So I just don't have any other ideas of what's going on !
Thanks again for your help.
Simon
I did speak to Adobe sales re: my frustration with this, and he indicated he's heard similar feedback. Here's to hoping that Adobe will consider coming up with a DataServices only license for LCDS which is more cost effective.
I'm still researching the viability of switching at this point to BlazeDS, and wonder if you can shed some light on how the CF setup works differently with BlazeDS vs LCDS. I understand that we'll loose RTMP, but polling will probably be fine. My big concern is the effort involved in re-writing hundreds of CFC gateway and DAO files to accomplish this.
Have you ported any existing projects from LCDS to BlazeDS on the CF side?
Thanks for the great post re: this (it's so difficult to find quality information on LCDS and CF).
Brendan
I understand a simple switch of protocols within LCDS doesn't change anything, but from what I can tell, the messenger/consumer setup of BlazeDS is completely different the use of DataService class with LCDS, which uses DAO, Assembler, and VO files for the CRUD operations.
Have you migrated a ColdFusion project from LCDS to BlazeDS without any changes?
I'm just gonna ask my boss $100 000 for LiveCycle, just to see he's reaction ;-0
http://bugs.adobe.com/jira/browse/BLZ-515