Do ColdFusion and Flex really place nice together?
The original blog post was about getting ColdFusion and Flex to share objects (CFC and ActionSCript Classes) back and forth. There is a cool automatic conversion from CFCs to ActionScript objects provided by the built-in ColdFusion AMF Gateway.
To make this work you have to specify the properties in the CFC, and the ActionScript object in the same order, using the same case sensitivity, and with the same data type. This is where Ionectu drops in:
"Adobe has gone through a lot of trouble to make sure that ColdFusion and Flex play really nice together"Translation : `Adobe` is retarded and here`s why, it`s quite simple.
With compilable languages, It`s a must to at least pretend to be able to create it once and leave it alone. It`s OOP not HTML ... amf remoting is `dependency central`. NORMAL people need to be able to change one end and not scrue up the entire thing, this is what development is about (in part), continuity, to have a flow that can be easily redirected.
Amf remoting remindes me of something along the lines of
if(this.file == "index") displayPage(1); else if(this.file == "page2") displayPage(2); else if(this.file == "page3") displayPage(3); else if(this.file == "page4") displayPage(4); else buy a hamster and teach it oop, it`s gonna come up with something better than Adobe did
The hell ?! Are all Adobe employees Google or Microsoft "rejects" ? (that`s not a nice thing to say, I know and I`m sorry, I`m just really pissed off, it just rubs me wrong.)
I, personally, think it is a big leap to call Adobe retarded for the Flex Remoting implementation in ColdFusion. It seems reasonable to me that when two completely separate systems have any similar objects used for the purpose of communicating between these two systems that when you change something on one system a similar change will have to made in the second.
As one example, If you change a database table, you may also have to change a Gateway Object or Data Access Object that relates to that table.
The sole purposes of Value Objects / Data Transfer Objects is to share data between two systems, in our case CF and Flex. IF you make changes to one side of the equation, it makes sense to me that you have to make changes to the other side.
Yes, the exchange is finicky in the order of properties on the objects, the data types of said properties, and the case sensitivity of the property names. CF is not case sensitive--most of the time--but Flex and most programming languages are. I accept the case sensitivity requirement without complaint.
I don't understand Ionectu comparison to the "If" condition. At the end of the day most development is some kind of if condition, isn't it?
I, basically, told that to the commenter, and he followed up:
In, Adobe`s making sure that CF and Flex play nice together they kind of forgot to teach them, how to understand and help each other. At the moment all that they can do is copy values from point a to point b (if you have points defined) (If you don`t you`re better off using wsdl btw). They don`t play nice togheter.. they just copy values from point a to point 1 from point b to point 2, the concept is the simplest I`ve ever seen .... this value goes here, this one here, and .... hm.. yep yep this goes here. Yeah that it. Client.as ....And if that took them year(s).. well then that`s just sad. They could have spend some time "implementing" some "usability"
How can they as a company think that it`s a success ... "Ok we did it!" .. "To use it you just have to set the same name, set the same position, set an id, on both ends ... and that might do it, I think that`s all". "We`ll call this a ... bridge? no , no, that`s not FLASHy enough.. we`ll call it a protocol.. yeah protocol" ... How can they call that a protocol :wallbash: when clearly it can`t even stand on it`s own "two" feet.
I believe there are huge benefits to using AMF, such as performance and packet size; so I don't agree that we'd be better off using WSDL.
The real question I have is, how else would you implement it? I'm not quite sure.
I can respect that it'd be nice if Flex and CF were a bit more aware of each other.
Why do the properties have to be defined in the same order? Why can't the AMF Gateway use the alias properties in CF and Flex to associate the CFC to the Class and then do some magic to match up properties and data types?
What are your thoughts on this issue?
Want to discuss this in person? Come visit the Flextras booth at 360|Flex in DC this September.




