How should I instantiate temporary models?'s Avatar

05 Dec, 2011 07:50 PM

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,

  1. Support Staff 1 Posted by Joel Hooks on 05 Dec, 2011 08:31 PM

    Joel Hooks's Avatar

    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.

  2. Support Staff 2 Posted by Joel Hooks on 05 Dec, 2011 08:32 PM

    Joel Hooks's Avatar

    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. 3 Posted by on 05 Dec, 2011 08:39 PM's Avatar

    Thank you a lot.
    I think "modules" is exactly what I need.

  4. Support Staff 4 Posted by Joel Hooks on 05 Dec, 2011 10:47 PM

    Joel Hooks's Avatar

    Cheers, let me know if you run into any snags.

  5. Joel Hooks closed this discussion on 05 Dec, 2011 10:47 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts


? 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