tag:robotlegs.tenderapp.com,2009-10-18:/discussions/problems/448-how-should-i-instantiate-temporary-modelsRobotlegs: Discussion 2013-04-28T09:53:43Ztag:robotlegs.tenderapp.com,2009-10-18:Comment/119003832011-12-05T19:50:20Z2011-12-05T19:50:21ZHow should I instantiate temporary models?<div><p>Hi,<br>
I'm creating a dashboard with two views. So I have main view with
two children, where each child view is a report.<br>
Should each of these views have its own model and mediator? And if
it's the case how should I create such models. I need them only
when I show the views. I don't understand when to instantiate such
models.</p>
<p>Thanks in advance,<br>
Alex</p></div>jed1k.rutag:robotlegs.tenderapp.com,2009-10-18:Comment/119003832011-12-05T20:31:05Z2011-12-05T20:31:05ZHow should I instantiate temporary models?<div><p>This largely depends on how you instantiate your view.
Personally I'd consider giving the view a Context and mapping these
items there. That would solve the problem nicely. You could
consider the modular utility to help with some of the issues you
might run into with that approach.</p>
<p><a href=
"http://joelhooks.com/2010/05/02/modular-robotlegs/">http://joelhooks.com/2010/05/02/modular-robotlegs/</a></p></div>Joel Hookstag:robotlegs.tenderapp.com,2009-10-18:Comment/119003832011-12-05T20:32:41Z2011-12-05T20:32:41ZHow should I instantiate temporary models?<div><p>You could also create the model in the mediator, but that feels
icky to me. These really are "modules" - even if they are
small.</p></div>Joel Hookstag:robotlegs.tenderapp.com,2009-10-18:Comment/119003832011-12-05T20:39:17Z2011-12-05T20:39:17ZHow should I instantiate temporary models?<div><p>Thank you a lot.<br>
I think "modules" is exactly what I need.</p></div>jed1k.rutag:robotlegs.tenderapp.com,2009-10-18:Comment/119003832011-12-05T22:47:43Z2011-12-05T22:47:43ZHow should I instantiate temporary models?<div><p>Cheers, let me know if you run into any snags.</p></div>Joel Hooks