Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8313367
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T20:28:09+00:00 2026-06-08T20:28:09+00:00

I have been following the modified Model View Controller example presented in this article

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T20:28:11+00:00Added an answer on June 8, 2026 at 8:28 pm

    I am not Java (or even desktop application) developer, so take this all with grain of salt.

    First of all, static fields in any code represent a global state, which is completely against any practices in object oriented code.

    As for your worries, that the code in tutorial violates SoC, you are right. But then again , it is intended as a basic tutorial, and not something too advanced. The goal is to show the parts of MVC triad and give at least surface level comprehension of how they interact and what are the main responsibilities. It is not meant to be copy-pasted in production code.

    Once clear sign for it would be, that there exists a “model object” in this code. In a real world situation model would be a layer.

    If you want to gain more extensive understanding of MVC, i can recommend three reading materials:

    • Patterns of Enterprise Application Architecture
    • A Description of the Model-View-Controller User Interface Paradigm in the Smalltalk-80 System
    • GUI Architectures
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been following the answer of this question: How to update existing object
I have been following this tutorial, http://ruby.railstutorial.org/chapters/modeling-users?version=3.2#top , which I find great, but it
I have been following the msdn example that shows how to hash data using
I have been following the usage of JavaScript for the past few years, and
I have been following the following post on using multiple ItemTemplates in a ListView
I have been following mozilla developer network's docs and created a transition for my
I have been following a couple of articles regarding RESTful web services with WCF
I have been following the validation for Entry boxes from here . The code
I have been following the affableBean tutorial from the NetBeans site located here .
I have been following a tutorial on how to write a basic tile map

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.