I have been following the modified Model View Controller example presented in this article by Oracle. Java SE Application Design with MVC
In this example the DefaultController class declares property name strings like this:
public static final String ELEMENT_TEXT_PROPERTY = "Text";
These strings are used in multiple places.
In the controller:
AbstractController uses reflection to search its models for a method named set+propertyName.
In the Model:
The model has setter methods which call this method:
firePropertyChange(Controller.NAME_PROPERTY, oldName, name);
In the View:
In the modelPropertyChange method,
if(evt.getPropertyName().equals(Controller.NAME_PROPERTY)
The part that concerns me is that the model is referencing the controller's static fields. I am still trying to master MVC and I am unsure if this architecture achieves the desired decoupling that MVC is used for. Does it matter that the all three classes reference the controller's static fields?
EDIT: Is the architecture described in this tutorial, as coded, an invalid representation of MVC? If so, can it be altered so that the model / (model layer) is not dependent on the static property names defined in the DefaultController class?
I realize this article is "just a tutorial", but if the code presented in it does not reflect the claimed decoupling, I think that the community should stop referencing it as an example of MVC.