• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Model-View Connection in MVC Pattern

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I feel what i will be working for is good candidate for MVC Design Pattern.
However I am held up with my "Model" and ways to update the "View" decision.
(I refered to other posts related to MVC and found out that "Model" design is something always interesting and bit difficult/confusing to start with).

Heres what the application does:
Its a "Multi-level" UI based application (ie one UI Screen for getting data from Producer for populating the screen and other UI for configuring the Producer state etc. Please read on for more info on "Producer").
I have no problem with "View" and "Controller" part since Swings implements the MVC Patterns itself.
However here is my "real hang":
User modifies an UI Element (lets say check box is clicked), "Controller" picks up the change in state and this info is passed on to "Producer" which is another system over ethernet link. The "Producer" replies back and based on reply the UI Element state is changed (ie to keep the checkbox selected or not, update JLabel content etc).
Refer attachement for Pictorial Representation (I truly belive "Picture speaks thousand words" ;-) )
The UI Application has no state of itself and everything depends on what is received from the "Producer".
Dreaded (atleast for me) question: Based on the attached picture "Worker" becomes my "Model" of MVC. However, what would be best way of updating the "View" whenever "Producer" Posts a change in state to the Application or User does a change and this change needs to be updated on view(based on reply from "Producer").
I guess what i am looking for is a good way to inform my "View" from my "Model" that you need update your view state.

I personally feel it would not be a good to have a reference of all the UI Frames in "Worker" and update accordingly.

Please let meknow in if my doubt isnt clear, i have tried my best to put forward in good way.
MVC_Design.jpg
[Thumbnail for MVC_Design.jpg]
Refered Attachment
 
Ranch Hand
Posts: 2187
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In your diagram, where is the Controller?
 
Santosh Kumar Raju
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi James,

Extremely sorry for not having replied soon.
Was down with health related probs
Hale and kicking now.

The controllers are the "associated Action Listeners" for user interface elements (ie check box etc.)

regards,
Santosh.
 
eat bricks! HA! And here's another one! And a tiny ad!
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic