How should I instantiate temporary models?
Hi,
I'm creating a dashboard with two views. So I have main view with
two children, where each child view is a report.
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.
Thanks in advance,
Alex
-
problem.png 7.15 KB
Comments are currently closed for this discussion. You can start a new one.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
Support Staff 1 Posted by Joel Hooks on 05 Dec, 2011 08:31 PM
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.
http://joelhooks.com/2010/05/02/modular-robotlegs/
Support Staff 2 Posted by Joel Hooks on 05 Dec, 2011 08:32 PM
You could also create the model in the mediator, but that feels icky to me. These really are "modules" - even if they are small.
3 Posted by jed1k.ru on 05 Dec, 2011 08:39 PM
Thank you a lot.
I think "modules" is exactly what I need.
Support Staff 4 Posted by Joel Hooks on 05 Dec, 2011 10:47 PM
Cheers, let me know if you run into any snags.
Joel Hooks closed this discussion on 05 Dec, 2011 10:47 PM.