This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes OO, Patterns, UML and Refactoring and the fly likes MVC:  Controller interface for handling popup windows Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » OO, Patterns, UML and Refactoring
Bookmark "MVC:  Controller interface for handling popup windows" Watch "MVC:  Controller interface for handling popup windows" New topic
Author

MVC: Controller interface for handling popup windows

Bill Clar
Ranch Hand

Joined: Sep 21, 2006
Posts: 150

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
internet detective
Marshal

Joined: May 26, 2003
Posts: 30130
    
150

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.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
Consider Paul's rocket mass heater.
 
subject: MVC: Controller interface for handling popup windows
 
Similar Threads
Passed 364/400
Passed SCJD
IBM Rational Functional tester: who knows ScriptAssure?
GUI Stuff
Question on MVC object creation