Welcome Guest, Not a member yet? Register   Sign In
Model Bouncing - Best Practices?
#1

[eluser]darioism[/eluser]
Didn't want to use the word "looping", but don't know what else to call it.

Let's say I have the following model:
Code:
$car_info = $this->cars->get($car_id);
I would design it to return an object with details about the car, and details about the manufacturer.

Then I also have the following model:
Code:
$manufacturer_info = $this->manufacturers->get($manufacturer_id);
I would design this to return an object of details about the manufacturer, and an array of cars produced by that manufacturer, with details of each car as an object.

The problem is, these models overlap and loop back and forth upon themselves, as they try to obtain information about each other's information. What would be a best practice as far as design in this case, and is there a programming term for this predicament? Thanks.


Messages In This Thread
Model Bouncing - Best Practices? - by El Forum - 09-03-2010, 06:59 PM
Model Bouncing - Best Practices? - by El Forum - 09-04-2010, 04:14 AM
Model Bouncing - Best Practices? - by El Forum - 09-04-2010, 05:18 AM
Model Bouncing - Best Practices? - by El Forum - 09-04-2010, 05:41 AM
Model Bouncing - Best Practices? - by El Forum - 09-04-2010, 11:35 AM



Theme © iAndrew 2016 - Forum software by © MyBB