Talk:Model–view–controller

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

Wiki Education Foundation-supported course assignment[edit]

This article is or was the subject of a Wiki Education Foundation-supported course assignment. Further details are available on the course page. Student editor(s): Mohammedhhassan.

Above undated message substituted from Template:Dashboard.wikiedu.org assignment by PrimeBOT (talk) 04:21, 17 January 2022 (UTC)[reply]

Picture issue[edit]

I share sentiment with comment above , that picture is disturbing . users (clients) should only interact with view objects while controllers 'goes' between views and model(data). 41.77.91.206 (talk) 07:17, 17 December 2021 (UTC)[reply]

I also concur. The diagram is incorrect. There's no direct interaction between the Model or View. WanderingFido (talk) 10:05, 17 January 2022 (UTC) [1][reply]

According to Krasner and Pope 1988: "The model carries out the prescribed operations, possibly changing its state, and broadcasts to its dependents (views and controllers) that it has changed, possibly telling them the nature of the change. Views can then inquire of the model about its new state, and update their display if necessary." so Model-View interaction is part of MVC as described in the original literature. But I do think there is room for improvement. The original literature includes the input and display devices as part of the diagram and also differentiates between state "change messages" and "access/editing messages". It may be useful to portray that distinction here. Elplatt (talk) 19:32, 26 January 2022 (UTC)[reply]

Also, I find the arrow from View to User irritating - shouldn't it go from User to View because the user sees the view (not the other way around?) --MikeVonBaden (talk) 17:01, 7 February 2022 (UTC)[reply]

I agree. The whole article is misleading. The UI talks to the controller, the controller talks to the model, the controller talks to the view, in the end the controller sends the results back to the UI. This article does more harm than good. Here is a good source video https://www.youtube.com/watch?v=pCvZtjoRq1I . Does anyone volunteer to fix it? CaliViking (talk) 00:43, 17 February 2022 (UTC)[reply]

As Elplatt noted, I think the fundamental trouble here is that no one can ever agree on what exactly MVC means, going all the way back to its origins. MVC started out in Smalltalk-79 in a very different form than the "View <-> Controller <-> Model" scheme that several people have described MVC as in this thread. Originally, a controller was a kind of UI widget that wrapped one or many views and took user input, sitting more between a view and the user than between a view and a model. It took a long historical process before the "View <-> Controller <-> Model" approach became widespread; my guess is that's become mainstream because of the popularity of 00's web application frameworks which followed that line. To help clear up the confusion both here and in general, I went ahead and fleshed out the History section more so that it's easier to see this development over time. I think it's pretty interesting—it seems like everyone who's talked about it presents it differently and various flavors of it have come in and out of vogue over the years. I tried to keep the existing text the same as much as I could, but I did make some small changes here and there for the sake of flow and a couple tiny inaccuracies. There's definitely more that could be done, especially to cover the '90s-era Java stuff and so on in greater detail. As for the diagram, I'd say it describes a flavor of MVC in the Smalltalk-80 vein. That's obviously different from the flavor seen in Rails and so on, but I don't think it's any more or less valid, so I slightly changed the caption to note that it just shows one kind of MVC. Mesocarp (talk) 12:29, 19 March 2022 (UTC)[reply]

References