|The subject of this article is controversial and content may be in dispute. When updating the article, be bold, but not reckless. Feel free to try to improve the article, but don't take it personally if your changes are reversed; instead, come here to the talk page to discuss them.
Please supply full citations when adding information, and consider tagging or removing unciteable information.
|This is the talk page for discussing improvements to the Model–view–controller article.
This is not a forum for general discussion of the article's subject.
|WikiProject Computer science||(Rated Start-class, Mid-importance)|
|This article is or was the subject of a Wiki Education Foundation-supported course assignment. Further details are available on the course page. Assigned student editor(s): Mohammedhhassan.|
Advantages and disadvantages
The only advantage listed is that MVC is more robust with respect to view instability than is having NO architectural separation of UI and business logic. And no disadvantages are listed, despite the section's name -- probably because nothing besides MVC is even mentioned. This section sorely needs some meat, I wish I had the knowledge to contribute it. — Preceding unsigned comment added by an unknown user 15 May 2006 126.96.36.199
- That's Interesting! How is it you know enough to attack the original article but you can't write-up improvements/corrections??? Loon. — Preceding unsigned comment added by 188.8.131.52 (talk) 20:19, 31 July 2016 (UTC)
I Agreed, most likely that this wiki is controlled by fans. — 184.108.40.206 13:27, 28 November 2006 — continues after insertion below
- So does this mean that you are now some how moral arbiters since you don't like MVC?? You wiki people are every bit as nuts as the media says you are. What a worthless pile of dung this has become. — Preceding unsigned comment added by 220.127.116.11 (talk) 20:19, 31 July 2016 (UTC)
There are (not exclusive) three "kind" of pattern idelogy, 3-tier, MVC and 3-layer and since different projects can have different trouble/needs, you must choice the best kind of model, not lets the model choose the workflow for you.
This models have their advantage and disadvantage, there was not a pattern that work for everything and MVC is not the exception. The real trouble with MVC is the lack of clarity with the concept, for example in some projects Model and Controller can be the same or view can be a blurry part of the model. — Preceding unsigned comment added by 18.104.22.168 (talk) 13:27, 28 November 2006 (UTC)
- NO, the real problem is just like REST, people with weak experience start telling other people what something is without really knowing themselves. — Preceding unsigned comment added by 22.214.171.124 (talk) 20:19, 31 July 2016 (UTC)
Pure MVC (where data flows from model -> view -> controller -> model) has the following advantages:
- Application behavior can be changed by modifying or swapping out the controller, without changing the model or how it gets rendered (view).
- A single model can be displayed to the user in different ways/places by different view types.
For instance, given a model that contains a list of e-mails, one view can display a list of the e-mails and their actual subjects, another view can just display the number of unread e-mails. When a controller makes changes to this one model, BAM both views are updated
- If you need to change all of the data a view is displaying, you just hot-swap its model.
For instance if you have an e-mail content view showing the contents of an e-mail selected in a list view, whenever the list model says the selected e-mail has changed, view logic simply swaps out the content view's e-mail model, replacing it with the new e-mail model.
Batch processing and MVC
Extend MVC to batch processing?
In applications that interact with users, with MVC or three tiers or three layers, the user sees the View and send instructions to the Controller through user events. It is possible to follow the same pattern for batch applications, even if these do normally not allow a user to participate. For example: a reporting program in batch:
- Model: the data in files or in database, from which a report has to be extracted.
- Controller: the reporting engine
- View: the resulting report
We can extend report here towards an output file. The conversion of some input data to an output file can also be considered as a reporting or extraction process.
- Model: the input data
- Controller: the exporting, mapping and / or extracting engine
- View: the output result
In the case of batch processes, there are normally no user events, and it is not user-event-driven. It is however possible that the database, file system or printer raise events or interrupts, based on the View (report, output data or output file), towards the Controller.
So in fact we could say:
- Controller: manipulates the Model
- Model: updates the View
- View: presented to the user or output device = the addressee
- addressee (user or output device): uses the Controller through events or interrupts
In fact, we could say MVCA, to include the addressee in the loop. But the A (addressee) is not part of the software. — Preceding unsigned comment added by LuMo (talk • contribs) 07:52, 8 July 2016 (UTC)