The moose likes OO, Patterns, UML and Refactoring and the fly likes MVC pattern Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Engineering » OO, Patterns, UML and Refactoring
Reply Bookmark "MVC pattern" Watch "MVC pattern" New topic
Author

MVC pattern

leo donahue
Ranch Hand

Joined: Apr 17, 2003
Posts: 327
I've seen a few variations of the MVC pattern when it comes to swing applications. However, my question is a little bit more general than just swing and it relates to what exactly belongs in the model.

I've adapted a sample I found online regarding the MVC pattern.

Should only the controller have access to update the View?

Is the code in Model.java considered "model" code, or does what I have in Model.java actually belong in Controller.java?

MVCDemo.java


Model.java


View.java


Controller.java


Thanks, leo
 
IntelliJ Java IDE
 
subject: MVC pattern
 
Threads others viewed
JCheckBox?
mouseClicked event for the "Cancel button"
This is MVC.
making a class visible
JTable(my model is changed how do i update my view)?
developer file tools

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture