ViewController in programming

Posted by Vishwas Gagrani on Programmers See other posts from Programmers or by Vishwas Gagrani
Published on 2013-05-12T16:11:30Z Indexed on 2013/11/09 10:15 UTC
Read the original article Hit count: 270

ViewController is a term for classes that handle views in a framework. This is especially used in MVC frameworks. I go through various projects, written by various programmers, who implement MVC in different ways. Especially, i get confused, about the relation between the MainView ( parent view ) and some CustomView ( widget etc) in the framework.

I personally pass reference of the MainView into the ViewController to be instantiated. All the subviews of ViewController are added to that reference of MainView. Additionally, ViewController itself is added as a child of MainView.

Like this :

main-view and view-controller relation

Want to know, if this is the right way to relate each other ?

© Programmers or respective owner

Related posts about programming-practices

Related posts about education