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 Developer Certification (SCJD/OCMJD) and the fly likes MVC Pattern in GUI 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 » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "MVC Pattern in GUI" Watch "MVC Pattern in GUI" New topic

MVC Pattern in GUI

John Smith
Ranch Hand

Joined: Oct 08, 2001
Posts: 2937
If I have 3 separate GUI frames (say, main frame, connect frame, and about frame), is it better to have a single controller where I would handle actions for all frames, or one controller for each frame?
Eugene Kononov.
Junilu Lacar

Joined: Feb 26, 2001
Posts: 4445

I'm not sure that you even need a controller for the connect and about frames. From what their names tell me, I would think that these frames have to do with support activities on the client side. They have nothing to do with the segregation of business logic and user interaction.
Using MVC doesn't mean that everything in your app needs to be participating in it. It's OK to handle some actions on the client side, especially those like "show application information" and "connect to Database".
IMO, the assignment doesn't have that many required actions to control so my own approach (I am just starting to work on my assignment myself) will be to start with just one controller. If it looks like it's going to be hard for a junior programmer to maintain, i.e. it turns into a Blob, I'll just refactor it.
Mark Spritzler

Joined: Feb 05, 2001
Posts: 17249

Good Answer.

Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
wood burning stoves
subject: MVC Pattern in GUI
Similar Threads
Frame within Frame
Inner classes and Mediator Pattern
MVC pattern again - with one class per view
Inter-Component communication in Swing
Frameset Refresh Problem