My preference is to return an array of value objects, so yes I hardly ever return a query unless it's going to end up in a pretty dumb list.
I'm careful with the number of records returned from a query though. You don't want to slavishly build value objects for thousands of records. Use blockfactor or narrow your criteria to return a smaller recordset. Implement paging if you need to. I've also found that you should avoid using getters and setters in server side value objects as they are slower than just setting public variables ie THIS scope. I always build client value objects as the code assist for their properties is a huge time saver and of course the strong typing catches all the silly typos. I don't know what your modelling but it's perfectly acceptable to build a value object representing a join. Most of our value objects are populated from data drawn from many different tables. I recently built a project where I first returned XML containing lots of elements (records) and then did parsing / building of value objects on the client. I wasn't happy with the speed so I did the parsing on the server and returned an array collection of value objects instead of XML. It was noticably faster. So yeah my preference is to return strongly typed objects in an array. HTH Angus On 22 Mar 2007 12:49:41 -0700, Brendan Meutzner <[EMAIL PROTECTED]> wrote:
Ben, Have you looked into the CF Connectivity wizards for creating cfc's to represent your AS object types? This is the way you're going to maintain the "object" properties between server and client side. If you'd like, I can blog an example of what I'm talking about. Brendan On 21 Mar 2007 15:31:39 -0700, Ben <[EMAIL PROTECTED]> wrote: > > Hi all, The message below was originally send to flashcoders > mailinglist, but later I figured it might be better of on Flexcoders. > > Ben > > ----- > > I am wondering how people are solving the following issue in the real > world. > > I am struggling to understand Flash Remoting with Coldfusion. I know it > should make my life a whole lot easier but at the moment it's not > reallyh helping :) All of the examples I find on the net are too > straightforward; select a table query and return that to flash (or in my > case flex). > > But in my situation, I want to return a joined recordset. How do I > return that recordset while maintaining the advantages of "object on > server is object in client"? I can return the whole query without > problems of course (plain old returntype=query) but what do I do after I > get that recordset in flash/flex? Is it still nescesarry to parse out > that resultset to make objects out of the recordset? Wouldn't that > defeat the whole purpose of remoting? (I used to do that in my xml > communication days too). > > While I am busy, might as well ask the following question to the > Coldfusion Remoting guru's out there too: What is best practice to let > CF retujrn to Flash? In code examples I see a lot of 'query' being > returned. But doesn't this go against the purpose of communicating only > "Objects" between the two layers? In my head I have this image of > letting Coldfusion return an Array of (e.g.) Person objects, when I > execute a (e.g.) getPerson command. > > Tnx for any insights in advance, > > Ben > -- Brendan Meutzner Stretch Media - RIA Adobe Flex Development [EMAIL PROTECTED] http://www.stretchmedia.ca

