Model View Controller (MVC)
The most famous user interface design pattern, MVC, has been around for quite a while. It was devised in the late 1970s for use in the development of Smalltalk-80. The problem its designers were initially trying to solve was that of how to bridge the gap between the human user’s mental model and the digital model of the computer.
Eventually they whittled it down to the famous MVC triad we know today representing 3 key concerns:
MVC Triad
Controller – Represents interactions, typically with the mouse or keyboard, or in the case of web applications, in the form of HTTP requests.
View – Renders the graphical output of the application
Model – Everything else. In particular this includes the data and business logic.
There are numerous other “triad” style user interface patterns. They all tend to feature some kind of concept of model and view, but the 3rd part (in this case the Control) tends to vary.
The other distinct trait of the MVC is that it is extremely loosely coupled. The Model knows nothing of the View or Controller, and similarly the View knows knows nothing of the controller either. One particularly useful side effect is that it is possible (and completely normal) to have multiple views for any given model. It is also relatively easy to change out parts (for example the viewing technology).
Testing is relatively easy. The Model and Controller are easy to test.
Model View Controller (MVC) The most famous user interface design pattern, MVC, has been around for quite a while. It was devised in the late 1970s for use in the development of Smalltalk-80. The problem its designers were initially trying to solve was that of how to bridge the gap between the human user’s mental model and the digital model of the computer. Eventually they whittled it down to the famous MVC triad we know today representing 3 key concerns:MVC Triad Controller – Represents interactions, typically with the mouse or keyboard, or in the case of web applications, in the form of HTTP requests. View – Renders the graphical output of the application Model – Everything else. In particular this includes the data and business logic. There are numerous other “triad” style user interface patterns. They all tend to feature some kind of concept of model and view, but the 3rd part (in this case the Control) tends to vary. The other distinct trait of the MVC is that it is extremely loosely coupled. The Model knows nothing of the View or Controller, and similarly the View knows knows nothing of the controller either. One particularly useful side effect is that it is possible (and completely normal) to have multiple views for any given model. It is also relatively easy to change out parts (for example the viewing technology). Testing is relatively easy. The Model and Controller are easy to test.
การแปล กรุณารอสักครู่..