Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

MVC

 
Fred Barnes
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guys,
I have a few question about implementing MVC.

1. I have designed my GUI so that when it starts up only the origin combobox is enabled. Once the user has selected the origin airport, I enable the destination combobox only with the apropiate destination. I do the same for the carier combobox. Should events like this still go in the controller class?
2. May the view call methods on my AbstractTableModel class?
3. I have a client side facade class with all the seach and book methods. Would this be my application model class then?
Regards
Fred
 
Fred Barnes
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guys,
One last question:
If my table model extends AbstractTableModel and I also would like to extends Observable?
Regards
Fred
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
#2 No, the view should not call any methods of any class, unless that class is specifically used for the Display.
The way I handle the TableModel, is when I get new data I create a new instance of my TableModel with that data, then use the setModel method of the JTable.
Mark
 
Fred Barnes
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Mark,
Thank you for your reply!
Regards
Fred
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic