I am trying to explore strategic solutions to convert my MySQL results into VOs for a Cairngorm App. I am using PHP5, MySQL 5 & AMFPHP 1.9.
My original thought was to: 1) Use arrays to map the MySQL field names to the VO properties and then call a fetch_array loop to convert the MySQL result to a PHP VO. Then, obviously, use $_explicitType to map that VO to the Flex VO. However, since PHP is not typed, I wonder if there is any benefit to returning PHP VO's at all. In that case I would choose option B: 2) Return the MySQL result to Flex and then convert the ArrayCollection in Flex to the proper Flex VO. I can see advantages & disadvantages to both ways. It seems like there is one less 'layer' by sending the ArrayCollection directly to PHP, however, there also is a benefit to only sending VO's back to Flex should I ever decide to integrate Java/FDS in the mix. I could then replace the PHP backend with Java by just returning Java objects instead of PHP. I am also wondering how all this deserialization affects performance on large datasets. I would to hear of any solutions/conclusions that others have arrived at in converting relational data into VO objects. Thanks, Kevin