connection between View and Child View in larger projects.

vishwas.gagrani's Avatar


02 Nov, 2012 07:30 AM

Ideally for a small program ( eg:, label view inside button view ) , i will always keep a reference of child-view inside the parent view.

But for bigger applications, that uses mvcs frameworks, what is right way ?

1) Keeping child-view reference inside the parent view class . And contacting it directly ( not via mediator )
2) Keeping no reference of child-view inside parent view class, and contacting it via mediator of the child view.

PS: I am assuming a sort of big application, where each view ( parent or child ) have their own big responsibilities .

Thanks for all the support!

  1. Support Staff 1 Posted by Ondina D.F. on 05 Nov, 2012 09:39 AM

    Ondina D.F.'s Avatar

    Hi Vishwas,
    My answer: both, 1. and 2., are valid approaches.
    In the case of mediated views, I’d prefer to let mediators communicate with each other, via events, on behalf of their views.
    But, as always, it depends on a concrete use case and/or the overall architecture of a project which approach you choose.

  2. 2 Posted by vishwas.gagrani on 05 Nov, 2012 10:34 AM

    vishwas.gagrani's Avatar

    hmm..ok. thnx for the inputs

  3. vishwas.gagrani closed this discussion on 05 Nov, 2012 10:34 AM.

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