Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

MVC

 
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
ranger
Posts: 17346
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Mark,
Thank you for your reply!
Regards
Fred
 
I think I'll just lie down here for a second. And ponder this tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic