GeeCON Prague 2014*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes MVC Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "MVC" Watch "MVC" New topic
Author

MVC

Fred Barnes
Ranch Hand

Joined: Jun 11, 2002
Posts: 62
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

Joined: Jun 11, 2002
Posts: 62
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

Joined: Feb 05, 2001
Posts: 17250
    
    6

#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


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Fred Barnes
Ranch Hand

Joined: Jun 11, 2002
Posts: 62
Hi Mark,
Thank you for your reply!
Regards
Fred
 
GeeCON Prague 2014
 
subject: MVC