(1.4.4) Model / View / Controller
With the word model, some people recall software design patterns called model-view-controllers (MVC). This is a pattern that divides the program into "model," means for showing the model to the user "view," and means for manipulating the model by the user "controller." So what is this "model" in this pattern? For example, if you create a program that counts how many times we press the button, the model is an integer value of the number of times pressed. The view is the code to display that integer value on the screen. The controller is the code to update the integer value when we press the button. (*35)
https://gyazo.com/589b5ba97e3cbac996d899c3e63c0959
It is the idea that the essential part of the program, the model, is left when we remove the parts relating to display and parts related to the operation from the program.
---
Footnote:
*35 The example of counters come from the following papers that introduced Smalltalk's usage in 1988. In the development of web applications, since we often use databases as the model part, many people think models equal databases. However, the original usage was not so. Krasner, Glenn E .; Pope, Stephen T. (1988). "A cookbook for using the model-view-controller user interface paradigm in Smalltalk-80". Journal of Object-Oriented Programming, 1 (3), 26-49. SIGS Publications.
en.icon
---
This page is auto-translated from /nishio/(1.4.4) Model / View / Controller. If you looks something interesting but the auto-translated English is not good enough to understand it, feel free to let me know at @nishio_en. I'm very happy to spread my thought to non-Japanese readers.