Upload
shinnosuke-kugimiya
View
2.958
Download
7
Embed Size (px)
Citation preview
ドメイン層
プレゼンテーション層
Presenter
Model
View
タッチなどのイベント
移譲
然るべき Modelのinterfaceをcall
ModelからのfeedbackはObserverPatterを用いて、View or Presenterへ通知するか
呼び出したPresenterにCallbackで返却するかのどちらでも良いと思う。
セオリーは前者だけど、githubのソースとか見ると後者の方が多い感じ。
return
return値をもとに
Viewを操作
android best practicesでも activityとfragmentって Controllerでもあるし
Viewでもあるよねって言ってる。
https://github.com/futurice/android-best-practices
ドメイン層
プレゼンテーション層
Controller
Model
View
タッチなどのイベント
Activityが この位置に居るので Model関連の処理を
Activityに書く事になる
Model View Controller
Activity
ドメイン層
プレゼンテーション層
Presenter
Model
View
タッチなどのイベント
Activityが この位置に居るので Modelと疎になり 書くべき事が減る
移譲
Model View Presenter
Activity