• 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

Layerered H-MVC - flow of control

 
Ranch Hand
Posts: 385
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I can't understand layered MVC. I have nested components/pages. Let's say A has B has C. I need to select appropriate radio button in C view, but event that triggers it happens in A view. Should I:

bController->getCController()->selectRadio(1)

or

make radio button state part of C model and change model... I.e. bController->getCController()->getModel()->setRadio(1).
 
Vladas Razas
Ranch Hand
Posts: 385
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well it should be selectRadio... Maybe it's better that all updates on model would be carried out by same controller. But still the question: do I have to have this kind of controller hierarchy?
 
Vladas Razas
Ranch Hand
Posts: 385
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Another question on MVC. Layered MVC and Chain of Responsibility. Should View construct and fire event or call Controller directly (and leave to controller decide to fire create event or not)? That would decouple View from Controller. It would be just another EventHandler, so View wouldn't be concerned is controller interested in some particular event or not. So we create and fire event in View or Controller?

You all must know MVC
 
These are not the droids you are looking for. Perhaps I can interest you in 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