The use of 'VO's in Flex has always confused me, largely because as everyone 
I've spoken to has explained it, all a 'Value' object is is just a Model object 
- therefore WTF are they being referred to as 'VO's when 'Object' (or Model 
object) would suffice. My understanding is that the Object representation's 
deep structure references objects ByRef, but Transfer Objects reference 
nonserializable/non-native objects by id.  That is, if you have Dog { id:int; 
parent:Dog; } the TO becomes DogTO {id:int; parentID:int;}

I'm still yet to have anyone explain it to me in a way which contradicts this 
way of looking at things.

--Tim

________________________________
From: [email protected] [mailto:[email protected]] On Behalf 
Of Nate Beck
Sent: Wednesday, 27 May 2009 7:53 AM
To: [email protected]
Subject: Re: [flexcoders] Value Objects




Hey Mike,

You'll see VO and DTO used interchangeably, I believe this is because Cairngorm 
used to use Data Transfer Object and then switched to Value Objects at some 
point.

That being said... this article gives a very basic example of passing data to 
and from a server strictly typed, which is what you are trying to accomplish.

http://flex.sys-con.com/node/505875 ( ick syscon... anyone know where the real 
article is? )

The key is the using the [RemoteClass(alias="java.package.Class")], so that 
when Flex serializes and de-serializes the object, it knows what corresponding 
class on the server your object represents.

I seem to recall that when creating VOs (or DTOs) with a ColdFusion service, 
you needed to add extra methods to assist in the serialization.

Maybe someone else add to this?  I've been out of CF for a while now.

On Tue, May 26, 2009 at 2:42 PM, mikeashields 
<[email protected]<mailto:[email protected]>> wrote:



I've come via a MySql to CF to Flex learning path.

As such, 1.) my flex app uses <mx:RemoteObject> with source= pointing at a CFC 
(in wwwroot/test/cfcs directory).

2.) Said cfc calls a MySql STORED PROCEDURE which returns (say) a list of 
"owners" (id, firstname, lastname, etc).

3.) CF passes this back to Flex (apparently in the form of an Object?).

4.) Flex then binds this returned data to a <mx:DataGrid>.

Now I've read extensively on VOs (as well as Cairngorm/MVC) yet don't fully 
understand either the "why" or the "how".

Assuming as basic an example as possible, I need to use AS3 to first define 
then instantiate an ownerVO, then a function to populate the ownerVO with the 
results of the RemoteObject then I populate the DataGrid with ownerVOs????

Comments and/or directions to appropriate learning resources appreciated.




--

Cheers,
Nate
----------------------------------------
http://blog.natebeck.net




Reply via email to