The best, shortest MVC articles I have found.
I have read some claims that absolutely nothing but
"getters()" and "setters()" should be placed in the
model. The following examples run counter to this
I really like the second example (Fred Swartz's)
because it is the MVC pattern without using the
Observable.class, making it easier for a beginner
Model-View-Controller Example Code
Fall 2002, David Matuszek
CIT597 MVC Example
Model-View-Controller (MVC) Structure
Copyleft 2004 Fred Swartz MIT License
Java: Model-View-Controller (MVC) Structure
This is not a trivial issue.
I will limit my comments to the "Model" part of MVC
because discussion of the "View" and "Control" can
First, consider creating a Model using only
getters() and setters(). You can't go wrong.
You will have created a perfect, portable
The next methods to consider are mutators().
David Matuszek has no getters() or setters()
in his code. He has one mutator(), code that
directly effects the Model. Implementing all
kinds of methods in the Model is not endorsed.
According to one computer science professor
I watched on a C++ video tutorial:
"The decision of into which class you place a
method is not a trivial matter."
It seems to me that MVC provides a
structure that helps us to make some of