Passing parameters made easy in java

public class Model {


public void updateEvent(String name, Date date,String start, String venue, String details,
String opportunity, String more, String end, String row) {
//do stuff here

}


public class Controller {

 public void someMethod() {

 if(button==view.saveButton) {

 model.updateEvent(view.txtEventName.......);

 } }

}

public class View {
public JTextField txtEventName;
//10 more consisting of textarea, datechooser, etc


} 

How can I pass a bunch of parameters to for Controller to pass to Model to update its state. Well, if the View is acting as form, it will have lots of text fields, text area etc. for data entry. rather than dealing with them individually how can controller gain access to all of them easily to pass to model. I dont want to simply keep adding view.txtWhere.getText() which is long.

Answers


Create an "Event" class that has String name, Date date,String start, String venue, String details, String opportunity, String more, String end, String row and use it instead ?


Need Your Help

Rate time limit error during search operation

java twitter4j

When I tried to get public tweets using twitter4j by searching keywords like (sports +exclude:retweets), I get the following error:

Page_load() is firing on checkbox selection

c# asp.net

Whenever i am trying to select the checkbox of treeview, the page is reloaded and the checkbox is again deselected.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.