model view controller - MVC Conception in java -
i need make java application use mvc model ( won't use controler avoid taht thigs complicated ) .
so can see in class diagram below have 2 package had problems when try interact between model , view .
the model.main composed of model.files , model.files composed of configfile,divaconnector , filesuploader. can put right links between classes ?
the controler allows communicate between model , view. put main class in extern package launcher , instanciate controler model , view args. main controler can instanciate controlers specific of each view.
class main { public static void main(string args[]) throws ioexception { model model = new model(); view view = new view(); controller controller = new controller(view, model); } }
edit : here example of main controler, in each specific controler builder put listeners (button, tableview, textfield ...), have both model , view, can alter chart elements according model.
package controller; import model.data; import view.frame; public class controller{ private frame frame; private data data; //controller private graphctrl graphctrl; private menuctrl menuctrl; private editctrl editctrl; private tablectrl tablectrl; //builder public controller(frame frame, data data){ this.frame=frame; this.data=data; build(); } public void build(){ graphctrl = new graphctrl(frame.getpanelg(), data); menuctrl = new menuctrl(frame, data); editctrl = new editctrl(frame.getpanels().getpaneledit(), frame.getpanelg(), data); tablectrl = new tablectrl(frame.getpanels().getpaneltable(), frame.getpanelg(), data); } }