I have a question about best practices and methodologies dealing with the ValueObjects.

Let's say I have my command class as follows:

   public function onResult( event : Object ) : Void
   {
         ModelLocator.workflowState = ModelLocator.VIEWING_MANAGER_SCREEN;
               
         var viewHelper = ViewLocator.getInstance().getViewHelper( "managerViewHelper" );
         viewHelper.setManagerForm(event.result);
   }

I then have my respective VO:

import org.nevis.cairngorm.vo.ValueObject;

class com.mydomain.admin.vo.ManagerVO implements ValueObject
{   
    public var ID : Number;
    public var firstName;
    public var lastName;
   
    public static var registered:Boolean = Object.registerClass( "com.mydomain.admin.vo.
ManagerVO", Manager VO );

}

and then we have my viewHelper

    public function setManagerForm ( result : Object ) : Void
    {
        view.tiFirstName.text = result.FIRSTNAME;
        view.tiLastName.text  = result.LASTNAME;

    }
  1. Should I set the ValueObject by calling it from the onResult handler. Is there a more direct way to set and populate values in both the form AND the VO? Right now, I'm calling the Helper and I somehow think I'm missing something with the VO....
  2. Should I include the MX Databinding (do i have to?) and if so, should I include it in the VO class or as part of the viewHelper class?
  3. Should I set and get individual fields (firstname, lastname, email) or should I use one big function that acts as a setter and getter for a whole form to populate the VO?
  4. Is it better to set the VOs inline (ex: text={delegate.setFirstName (vo.firstname)} or should I call a function that gets and sets the values?

Dave


Yahoo! Groups Links

Reply via email to