• 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

NX: About to upload - quick MVC question

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All
I have coded my MVC using the hook methods described in previous posts. One thing is bugging me though (last minute check before upload) - should the view ONLY be passing on actions to the controller that will ultimately require the controller to pass onto the model? For example, I can see how a search action or a book action should work, but what about displaying help or having a button to clear the search criteria? They could be achieved entirely within the view.
Sorry, if this question is a bit simple, Im fairly new to MVC! I would be extremly grateful if someone could put me out of my misery and post soon!
Many Thanks
Jamie
 
Jamie Orme
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
BTW my current set-up is to have any actions that do not require the model totally within the view (not using 'hook' methods).
Cheers
Jamie
 
author and jackaroo
Posts: 12200
280
Mac IntelliJ IDE Firefox Browser Oracle C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Jamie,
There are some things that can be done completely within the view. You mentioned clearing fields. Another might be initial validation of a field.
There are other interactions that might not need to go via the controller either - the diagram in the Sun Model-View-Controller Blueprint tells you that the View can send a State query to the Model. It is only user gestures that should go via the controller. You could argue that finding out the names of the columns could fall under the state query category, so you could get that directly from the model. But changing the data the model is holding (by doing a query) falls under the user gestures category.
As for the user help - I guess that depends on how you implemented it. Personally I had user help in several seperate help files. These had their own model which retrieved them (to hide the fact that they were in physical files). Since I had several help files, requesting different bits of help could result in the data being modeled by the help model changing. Therefore help requests were sent via the controllers. (I also had a separate view for the online help, in it's own JFrame, but that is a separate story).
Does this clarify it? Or have I just confused you further?
Regards, Andrew
 
Jamie Orme
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Andrew
Thanks for the reply.
I think I follow what you are saying (it is early in the morning here in the UK ). I think I will leave things as they are and not implement the 'hook' methods for any action that doesnt require the model (anyone have a contradictary view on this?) . BTW my on-line help is in HTML, that that has a front page with links to specific items. Its not brilliant, but it does the job!
Thanks again
Jamie
 
You got style baby! More than this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic