• 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

Model and View relationship

 
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Fellow Ranchers,
I have a question about the relationship between the View and the Model. According to the MVC pattern the Model should notify the View of state changes. Some posters have proposed using the fireXXX... methods to take care of that, notifying JTables in the View from the TableModel in the Model. My concern is doesn't this create a strong coupling between the classes?
Is it better to use the plain old Observer pattern and just shuttle text-based data from the Model to the View.
Incidentally, some people (who have passed the assignment) did not have the Model notify the View, but used the Controller for that purpose. This sounds strange to me,

Cheers and TIA,
Alex
 
Ranch Hand
Posts: 117
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I don't think it creates a strong coupling. The model and table model don't need to know anything about the table model listeners. The JTable is a listener just because it was constructed using the table model.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic