Separating the issues that are cited as an advantage of MVC is also in fact the promotion of a three-layer / three-level system. There, too, the business logic is independent and can be used from different levels of presentation.
The main difference is that in a classic MVC model, it can have a reference back to a view. This means that when the data is updated, the model can return this data in several possible forms. The first example is a desktop application where data is visualized in several ways. It can be as simple as a table and graph. A table change (which is a change in one view) is first transferred through the controller to the model, which then returns it back to the chart (another view). Then the graph is updated.
Since desktop development is in decline, many programmers are only coming into contact with MVC in some kind of web-based option, for example. via JSF in Java EE.
In these cases, the model almost never refers to the view. This is due to the fact that basically the website is based on a request / response and after the request has been submitted, the server cannot send additional information. That is, an update transferred from the model to the client will be meaningless. With the reverse ajax / comet, this is changing, but many MVC web structures still do not fully utilize this.
Thus, in the case of web MVC, the typical “triangle” between M, V, and C is smaller, and the MVC variant is actually closer to the n-level model than the “true” MVC.
Also note that some MVC web structures have an intermediate piece of plumbing between M, V, and C called bean support (Java / JSF) or code (ASP.NET). In JSF, the controller is provided by the framework, and the view is often not attached directly to the model, but uses this bean support as an intermediary. The bean foundation is very thin and basically just pre-displays the data from the model in one direction and translates the messages specific to the model (for example, exceptions) to view specific messages (for example, some human-readable texts).
Arjan Tijms Jan 01 '10 at 8:22 2011-01-01 08:22
source share