AMFPHP did this really well with result sets too - straight out of the box like CF.

Yeah, that's what I expect Zend AMF to do as well, but I haven't tried it yet.
Maybe I'll take it for a spin this evening if I find the time..

The only *gotcha* with sending query results straight from CF to Flex/Flash is 
that table column names all become uppercase.
Not sure if AMFPHP did the same (been too long since I used it).
So that might be something to look out for with Zend AMF as well, but it may 
just be a (annoying) CF thing.

Let's say you have a user table with "firstName" and "lastName" columns.
When sending a query result straight to Flex/Flash (from CF) it looks like this:

[{FIRSTNAME:"value", LASTNAME:"value"}, {FIRSTNAME:"value", LASTNAME:"value"}];
rather than:
[{firstName:"value", lastName:"value"}, {firstName:"value", lastName:"value"}];


regards,
Muzak

----- Original Message ----- From: "Glen Pike" <g...@engineeredarts.co.uk>
To: "Flash Coders List" <flashcoders@chattyfig.figleaf.com>
Sent: Monday, March 30, 2009 4:23 PM
Subject: Re: [Flashcoders] Best data type for Zend AMF


AMFPHP did this really well with result sets too - straight out of the box like CF.

Muzak wrote:
For database type data, Array of Objects.
Forget about XML.

With Coldfusion (and remoting) you can grab a database query result and just send that straight to Flash/Flex and it will be transformed into an Array of Objects automatically.

In CF it's as simple as:

<cfset var rsResult="" />
<cfquery name="rsResult" other stuff..>
   SELECT * FROM table_name
</cfquery>
<cfreturn rsResult />

Seems they're still working on mapping PHP to AS objects:
http://wadearnold.com/blog/?p=54
Allthough, the article is from sept 2008, so it may have been implemented by now.

So if class mappings are implemented (still have to take Zend AMF for a spin) then that's the *best* option, but probably not the *fastest*. At least in Coldfusion transforming plain vanilla objects into typed objects slows things down (especially with lots of data).

regards,
Muzak


_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to