• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

GUI design, MVC question

 
Ranch Hand
Posts: 194
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, I have not done much GUI work in my job. So, please bear with me-
I have put all the ActionListener/TableModelListener implementation in my Controller. The Controller calls the my View telling it to update the view - even for actions that do not cause a database request in the server (i.e, a shallow request such as data validation failed, show an error message dialog.) Is this the correct way to do it or should I let the Controller handle only those requests that cause the DataAccessFacade methods to be invoked?
Thanks much!
 
Ranch Hand
Posts: 2937
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


I have put all the ActionListener/TableModelListener implementation in my Controller. The Controller calls the my View telling it to update the view - even for actions that do not cause a database request in the server (i.e, a shallow request such as data validation failed, show an error message dialog.) Is this the correct way to do it or should I let the Controller handle only those requests that cause the DataAccessFacade methods to be invoked?


What acts as a Model in your MVC, -- you didn't mention it?
Eugene.
 
Aruna Raghavan
Ranch Hand
Posts: 194
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
DataAccessFacade and the RMI server name lookup are part of my Model.
 
Aruna Raghavan
Ranch Hand
Posts: 194
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hmm..
The more I look at this, the more I feel that there is no need for the Controller to get involved for trivial actions performed, but rather to get involved just when the Model is used.
 
Aruna Raghavan
Ranch Hand
Posts: 194
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I decided to have anonymous inner classes to handle trivial events that don't require Controller intervention.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic