メモ:MVCのModelは、なぜModel---模型---と呼ばれるのか

MVCのModelは、なぜModel---模型---と呼ばれるのか
よくModelはビジネスロジックを実装するファクターである、と説明される。しかしビジネスロジックとはアプリケーションの本体なのだから、本体を「Model」(模型)と呼ぶのはおかしいのではないか、といつも腑に落ちなかったが、「MVCについての最初の論文」を少し眺めてみて、自分なりに答えを出した。

Wikipedia --MVC--
MVCについての最初の論文「A Cookbook for Using the Model-View-Controller User Interface Paradigm in Smalltalk -80」

・とりあえず出した答え
「MVCは、GUIのための設計指針であり、アプリケーション本体のシェルを作るための思想である。Modelはシェルを作るためのシェルの見た目とアプリケーションを媒介する、「アプリケーション本体のModel(模型)」である」

MVCは、最初はsmalltalkにおけるウィンドウプログラム開発のための設計指針として生まれた、とWikipediaにある。つまり端緒からGUIのための指針だった。
GUIはあくまでアプリケーション本体ではなく、アプリケーションとユーザーの対話を媒介するシェルの一種である。つまるところ、MVCとはシェルについての設計指針である。
シェルはアプリケーション本体の機能にアクセスし、必要に応じて状態を変えるための対ユーザー入出力としてある。シェルはアプリケーションの領域全てにアクセスできる必要はないし、するべきではない。
直接アクセスする代わりに、整理・抽象化された「Model(模型)」、つまり整理され抽象化、集約されたロジック、抽象化の層を持つのがよい。
Modelは、アプリケーション本体とViewとの中継点、IF、アダプターであると言えるのではないか。
このような媒介のファクターは、GUIプログラムを書くと意識せずとも必然的に現れてくるが、それを明確に定義したのが、Modelという考え方なのだと理解した。

以下、引用  「Simulation」という言葉が目に付いた。

Model-View-Controller (MVC) programming is the application of this three-way factoring, whereby objects of different classes take over the operations related to the application domain (the model), the display of the application's state (the view), and the user interaction with the model and the view (the controller). 


The Model-View-Controller Metaphor


To address the issues outlined above, the Model-View-Controller metaphor and its application structuring paradigm for thinking about (and implementing) interactive application components was developed.  Models are those components of the system application that actually do the work (simulation of the application domain). 

Models


The model of an application is the domain-specific software simulation or implementation of the application's central structure. 




コメント

このブログの人気の投稿

分散処理など

VBAでEdge操作は不可能ではないが、ナンセンス

docker+nginx+wordpress リバースプロキシにてはまった件