9. Models represent knowledge.
Modelとは知識を表す。(この知識って訳は微妙かも)
!
A view is a (visual) representation of its model.
ViewはModelの視覚的な表示である。
!
A controller is the link between a user and the system.
Controllerはユーザとシステムのリンクである。
Trygve Reenskaug曰く①
via http://heim.ifi.uio.no/ trygver/1979/mvc-1/1979-05-MVC.pdf
10. The essential purpose of MVC is to bridge the gap between the
human user's mental model and the digital model that exists in the
computer.
!
MVCの本質的な目的はユーザのメンタルモデルと
コンピュータのデジタルモデルのギャップに
橋を架ける事。
Trygve Reenskaug曰く②
via http://heim.ifi.uio.no/ trygver/themes/mvc/mvc-index.html
11. The structure is useful if the user needs to see the same model
element simultaneously in different contexts and/or from different
viewpoints.
!
この構造はユーザが違う立場、状況から
同じモデルを見るときに有効である。
Trygve Reenskaug曰く③
via http://heim.ifi.uio.no/ trygver/themes/mvc/mvc-index.html
14. Smalltalk-80でのMVC
Model
The model of an application is the domain-specific software
simulation or implementation of the application's central structure.
This can be as simple as an integer (as the model of a
counter) or string (as the model of a text editor). or it can be a
complex object.
Modelはドメインのシミュレーションもしくは
アプリの中心的な構造の実装である。
カウンターのModelであれば
単純なintegerそのものでもありえるし、
テキストエディターであるのならStringそのものでもありえるし、
また複雑なオブジェクトにもなり得る。
15. Smalltalk-80でのMVC
View
views deal with everything graphical:
they request data from their model, and display the data.
Viewは視覚的なすべてを扱う。
モデルにデータをリクエストして、それを表示する。
16. Smalltalk-80でのMVC
Controller
Controllers contain the interface between
their associated models and views
and the input devices (keyboard, pointing device, time).
Controllers also deal with scheduling interactions
with other view-controller pairs
ControllerはModel、View、入力デバイス間の
インターフェースを持つ。
またほかのView-Controllerペア間のスケジューリングも扱う。
17. Smalltalk-80でのMVC 補足
Broadcasting Change
In the scheme described above. views and controllers have
exactly one model. but a model can have one or several views
and controllers associated with it. To maximize data encapsulation
and thus code reusability. views and controllers need to
know about their model explicitly. but models should not know
about their views and controllers.
A change in a model is often triggered by a controller connecting
a user action to a message sent to the model. This
change should be reflected in all of its views. not just the view
associated with the controller that initiated the change.
ControllerとViewは一つのModelをもつが、
Modelは複数のViewやControllerを持つ事ができる。
ControllerとViewはModelであると明確に知っている必要があるが
Modelは彼らがControllerやViewであると知っている必要はない。
あるControllerからModelに通知がいき変化があったとき、
その変化はそのControllerに付随するViewだけでなく全てのViewに
通知されるべき。