1

I am trying to learn more about the MVC architecture and implement it into my JavaScript app. I have gone through several articles and videos explaining the MVC arch and most of them have a diagram showing the structure and it begins with the user sending a request to the 'C' (Controller) first then it pass the request to the 'Model' and so on.

Diagram like this one here: https://miro.medium.com/max/700/0*A2NPgocJSjAa2YNe.png

But as far as I have understood about the MVC, the 'View' which represents the UI of the app is where the User actually interacts(e.g creating a new item ) and these changes are passed to the 'Controller' then to the 'Model' and so on. Here is one answer which explains about my understanding in a simple way - https://stackoverflow.com/a/1015853/13406292[2]

So it got me thinking: Why do in the articles they show the request starting from the 'Controller' and not from the 'View' where the user actually first interact and thus triggering the event ? Can anyone help me clear this out.

FluffyRidz
  • 89
  • 1
  • 8
  • 1
    Technically the user makes the request to the controller through the view but the request is actually intended for the controller. – Rifat Bin Reza Feb 18 '21 at 06:20
  • 2
    The MVC architecture is not a rigid one. It's more of a suggestion for how functionality should be organised. *Conceptually*, the user will be issuing orders to the controller, however, *in practice*, users rarely have direct access to the controller. The UI can have a direct pass-through to forward user interactions to a controller which is the midway point between the two concepts - the user interacts with the view and the commands go to the controller. Also worth noting that MVC is quite simplistic in its approach - usually there is a lot more going on than just these three areas. – VLAZ Feb 18 '21 at 06:20

0 Answers0