Welcome Guest, Not a member yet? Register   Sign In
Make a more robust Request Cache
#4

[eluser]jedd[/eluser]
[quote author="j2more" date="1255821032"]
What about situations where you would just like a convinient way to return multiple Objects from a method but.
[/quote]

[quote author="j2more" date="1260858373"]
Eg. you return already an array ...
[/quote]

Return already? I thought you were talking about a situation where you want to return multiple objects from a method? If you are happy to call multiple methods to get individual objects on each call, then, yeah, sure, why not. Doesn't seem very elegant to me, though.

Quote:...or you want to use the object way later in the code without passing it along all the invocation graph.

An array of objects means you can easily extract / copy / use the object that came back inside the array (of objects).

I still believe this is a cleaner approach than subverting the return $value mechanism by wedging some data into the Session space in the model, then looking for it later in the controller.

If you want to go a bit more OO, then have the model populate a bunch of attributes, and then refer to them from the controller.


Messages In This Thread
Make a more robust Request Cache - by El Forum - 10-17-2009, 12:10 PM
Make a more robust Request Cache - by El Forum - 10-17-2009, 12:29 PM
Make a more robust Request Cache - by El Forum - 12-14-2009, 06:26 PM
Make a more robust Request Cache - by El Forum - 12-14-2009, 07:30 PM



Theme © iAndrew 2016 - Forum software by © MyBB