NISHIO Hirokazu[Translate]
(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)


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
[<<< Previous:(1.4.3.2) Hide non-critical parts = Extract important parts] [Next: (1.4.5) Pattern Discovery >>>]

Engineer's way of creating knowledge > (1) How to learn > (1.4) What is abstraction? > (1.4.4) Model / View / Controller

"Engineer's way of creating knowledge" the English version of my book is now available on [Engineer's way of creating knowledge]

(C)NISHIO Hirokazu / Converted from [Scrapbox] at [Edit]