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 8740215
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T11:05:31+00:00 2026-06-13T11:05:31+00:00

I am having some troubles understanding and implementing the MVC pattern. I have a

  • 0

I am having some troubles understanding and implementing the MVC pattern.

I have a singleton “model” class which contains all the datas of the application and extends Observable. When those data are modified, I want to update the views, and when one of the views receives some input from the user, I want to update the model. In between stands a Controller (implements Observer) which has an instance of both the view and the model.

I think that to do this, the views must have an instance of the controller. Whenever it receives an event from a button or any component, it calls the correct controller’s method, which transmit the informations to the model. The model is updated and notifies the observer which in turn will update every components of all the views, even if they are not linked to the particular data which has been modified, since the Controller can’t know what has been modified in the model. I am not sure this is a good design.

I looked a bit upon the PropertyChangeListener class, which seems to correct this issue but I am not so sure that I understand everything. Is there any preferred way to do this ?

Thanks in advance !

  • 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-13T11:05:32+00:00Added an answer on June 13, 2026 at 11:05 am

    There are a few issues with what you’re suggesting.

    First of all, you’re describing MVVM, not MVC.

    The second problem is that the terms model and controller aren’t suppose to describe singletons. They are merely terms to help you separate concerns by organizing your logic into classes with well-defined responsibilities.

    The MVC structure is as follows:

    The Model

    This is your application logic/business rules. This basically means that if your application is about a phone book, then all logic and data structures that have to do with providing a phone book API is implemented here.

    The View

    This layer is completely separate from the model, in that it doesn’t care about data structures or logic, but only on presenting simple values. Strings, integers, collections, you name it. But it doesn’t care about the model’s API, it only depends on the controller’s.

    The Controller

    This is where things come together. The controller is the mediator. It speaks the language of the model, and that of the view, and it can make them work together. User requests are routed to the controller.
    For example, a request might want to list all numbers in the phone book. What happens is:

    1. The controller receives the request
    2. Asks the model for all numbers that exist in the phone book via the model’s API
    3. [Optionally] converts the data into a data structure which the view is intended to display
    4. Passes the data to the view

    One last remark before we finish:

    If the controller doesn’t convert data from the model into something simple, then allegedly the view is now tightly-coupled with the model. However, that doesn’t always have to be the case. Even if the model’s API changes, then the controller might still be able to adapt the new API into the old API, which the view already understands.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having some troubles understanding how Guice's singleton instantiations works. I've read the available
I'm having some trouble understanding this issue. I have a class: class StringProperty {
I am having some troubles with understanding the circumstances under which Silverlight downloads a
I'm having some troubles understanding MPL placeholders. Could someone please explain me why this
I am having some troubles understanding the object relationships in Django. I wrote this:
Having some trouble understanding the right approach here. I have a connection to a
I'm having some trouble understanding how codeigniters loading works. Well first you have the
I'm having some troubles in understanding Git team-working principles. Consider a team of two
Having some trouble understanding variable scope within a class structure. I want to create
I'm having some trouble understanding the rules for array broadcasting in Numpy. Obviously, if

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.