Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Correct programming/semantic for MVC in my application.

 
Josh Borg
Ranch Hand
Posts: 35
Chrome Eclipse IDE Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, I am making a program and I have the View who should get input and send it to Controller, but I want to know how. Is incorrect to get the Bean in the view, and in the save button and send it to Controller? How I send all this information?
I should make a method with all the arguments in the controler like this?



Really thanks.
 
karthick meyyappan
Ranch Hand
Posts: 43
MyEclipse IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi josh,
i read your context more than two times. i cant able to come to a conclusion what are trying to say and what you are trying do.
so please re-phrase it. please framework details and your usecase/requirement details.

thanks.
 
John Vorwald
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try to set up a MVC construction first, and get data to pass from the view to the models, and messages from the models to the views, via the controller. The approach that I used was to declare the controller(s) in main, and pass the controller(s) to the views / models constructors. Also, register the views / models inside the controller so the controller can call all the models / views. Then the views / models can call the controller and vice versa. Also, you can set a property and use the property name to create a method name, ie set_+propertyName. Then check the views and models for the existence of that method, and call the method appropriately. But, there is probably an easier way to do this using messages.... Be careful about multi thread access too.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic