I am not sure what the best practice is, but I often bind UI items directly to objects in my model - sometimes a particular instance might be bound to multiple controls both inbound and outbound. Because of this, sending the objects in my model directly to a remote service could suffer from the "bound properties disappear" bug in flex. So I typically treat VO objects sort of like a railroad car to dump things into.

For example, I might have a Person class which encapsulates some data in my model. I'll make a Person.ReturnVO object which just takes the public properties from that instance and copies them to a PersonVO object, which I then send separately. Since PersonVO is just a subset of a Person object, I sometimes just pass over a copied object, but I try never to pass over the actual object that I'm using on the client side, always a copy.

I'm not sure this is really a best practice, but it does get around the disappearing properties bug in Flex, so it works for now. I think that IterationTwo tends to stay a bit farther back from encapsulation than I do, but I like having intelligent objects for my commands to get/set values from/to.

Sean



On Sep 15, 2005, at 10:02 AM, dave buhler wrote:

Hello Everyone,

I had a question regarding best practices when passing over my valueobjects.

In Short, I've been alternating between two ways of referencing the
VOs properties:

1) assigning the VO as a new object in my command, and passing over
this new object  or new object's props to my Delegate as a parameter
2) just importing the VO directly into the delegate and referencing
the VO's properties when I pass it over to my CFC.

What is considered best practice when working with the commands and
delegates with regard to specifying props of my ValueObjects? Where
should it be done?

Dave


--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




YAHOO! GROUPS LINKS







--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




YAHOO! GROUPS LINKS




Reply via email to