Futurescale, Inc. PureMVC Home

The PureMVC Framework Code at the Speed of Thought


Over 10 years of community discussion and knowledge are maintained here as a read-only archive.

New discussions should be taken up in issues on the appropriate projects at https://github.com/PureMVC

Pages: [1]
Print
Author Topic: Hi, an complex Vo question  (Read 5956 times)
wssbwssb
Newbie
*
Posts: 5


View Profile Email
« on: May 21, 2009, 10:39:04 »

Hi,

I created two Vo.

   Class BookVo
   {
      public var name:String
      public var type:BookTypeVo;
   }

    class BookTypeVo
    {
        public var name:String
        public var name:String
    }

BookVo has a BookTypeVo as it's property.
When I start my app.I created two proxies named BookProxy and BookTypeProxy to manager the two type of vos.

The question is when I create BookVo instance, I need a BookTypeVo instance.
Is it better to retrieve BookTypeProxy in BookProxy directly?
Or should I create a command to handle the BookVo's creation?

Thanks.
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #1 on: May 22, 2009, 04:47:53 »

You might want to do the assembly in a command to keep it loose. There's nothing wrong with accessing other proxies from within a proxy, but you rely on the app to have registered them unless you do that registration in the parent proxy.

In this case you could create and register the BookTypeProxy in the onRegister method  of the book proxy. Keep a local reference to it in the book proxy if you'd like.

-=Cliff>
Logged
Pages: [1]
Print