MVC Architecture different in different sources

1 reply · 2K views · last reply
shivajikobardan
Messages
637
Reaction score
54
Homework Statement
Different architecture of MVC given, which one is most relevant?
Relevant Equations
None
Diagram of the MVC cycle with blue Controller box at top, green View box at bottom left, and yellow Model box at bottom right, linked by numbered arrows 1 to 5 showing user interaction flow.

Source: https://www.chromeinfotech.net/blog/model-view-controller-architecture/
Diagram of MVC architecture with boxes for Browser, Web Server, Routes, Dispatcher, Controller, Model (labelled MySQL), and View, with arrows showing the request and response flow between them.

Source: University of Virginia Computer Science, Engineering Department youtube lecture.

Here're my 2 questions:
1) Does user interacts first with a view or controller?
2) Does model sends output directly to view or via Controller?
 
There are as many different interpretations of MVC architecture as there are programmers so there is no right answer here. Having said that I would rely more on the U. of Virginia than on some random one-man-band developer's blog.

To give this random one-man-band developer's thoughts:
Q1
In a Web 1.0 app (which is what is pictured in the second picture) there is no direct interaction between the user and the view, everything goes through the controller.
In a locally installed app, or in a Web 2.0 app, there may be direct interaction between the user and the view.

Q2
How data gets from the model to the view is not important, what is important in MVC is that a view must not be able to change state in a model. If the view does interact directly with the model then this becomes MVVM (model-view-viewmodel) rather than MVC.
 
  • Like
Likes   Reactions: shivajikobardan