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

Show Posts

* | |

  Show Posts
Pages: [1]
1  Announcements and General Discussion / Architecture / Re: Call proxy from VO? on: August 01, 2011, 05:39:57
Thank you Cliff.

Now a follow-up question in relation to the topic.

Instead of adding a getter in the VO, what if I create a variable called car that will hold the CarVO that will be filled when I receive the parts.

Explained in a more logical manner:
1. Cars are received into the CarsProxy and stored in an Array of CarVO's.
2. Parts are received as an array and looped through to add a carVO to each of the parts.

PartVO would look like this:
:
package com.carparts.model.vo {
public class PartVO {
public var IDPart:int;
public var IDCar:int;
public var Price:Number;
public var Size:Number;

public var carVO:CarVO;
}
}

This way I can get to the car information quickly and painlessly.

The question is if this will bind up more memory on the client computer or not? Maybe there are some other drawbacks of doing it like this?

/Goran
2  Announcements and General Discussion / Architecture / Call proxy from VO? on: July 15, 2011, 12:16:34
Is it bad or OK to call a proxy from a VO?

If it's not OK, why not?

Let's say I have two different proxies, one for cars and another for car parts used on different cars. If I open a car part I will have the ID to the car it fits on, so why can't I retrieve the car proxy in the VO and return the related car VO right there?

:
package com.carparts.model.vo {
public class CarVO {
public var IDCar:int;
public var Brand:String;
public var Wheels:int;
public var Color:String;
}
}

package com.carparts.model.vo {
import com.carparts.ApplicationFacade;
import com.carparts.model.CarsProxy;

public class PartVO {
public var IDPart:int;
public var IDCar:int;
public var Price:Number;
public var Size:Number;
}

public function get car():CarVO {
// The CarsProxy has a dictionary of all different cars indexed by IDCar.

var carsProxy:CarsProxy = ApplicationFacade.getInstance().retrieveProxy(CarsProxy.NAME) as CarsProxy;
return carsProxy.carsDictionary[IDCar];
}
}
Pages: [1]