5
512GB
6y

Something about MVC. If one clicks on the UI to open a menu, is the event sent to the controller which updates the view or does the view "just display the menu"?

Comments
  • 3
    Good question. Imo MVC is one of the most overrated patterns
  • 1
    Depends on how you app is working. If the full menu is already on client side (in browser) than is just the view showing other things, but if you load the submenu after clicking via e.g. ajax than the ajax request is of course sent to the controller.
  • 1
    @PaulTheSaltyDev what is your fav pattern?
  • 1
    @bosi OH sorry for not clarifying. I mean in native local apps in full c++
  • 3
    Depends. Geberally, you should only ping the controller with requests if the thing you want to display is dynamic. If you have a static menu, then by no means should the controller take care of it. If you are in doubt, ask yourself 'does this input effect the database/api/whatever in any way?'
Add Comment