• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

MVC: Controller interface for handling popup windows

 
Bill Clar
Ranch Hand
Posts: 163
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm studying up on the MVC pattern in "Head First Design Patterns" and applying it to my Swing application. The application consists of a main window with a menu bar. From the menu bar the user can "Print", "Change Password", or "Exit". Clicking on either "Print" or "Change Password" will open a new window.

Should my controller interface care about the opening of these windows? Do I need to put openPrintWindow() and openChangePasswordWindow() in my controller interface? The alternative is to keep the functionality directly in the menu bar, but that leaves the functionality in the hands of the View. I'm unsure if that's a good programming practice.


 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34641
363
Eclipse IDE Java VI Editor
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bill,
In order to be doing MVC, you would need those methods. As far as MVC goes, a popup is just like a regular window.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic