SlideShare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our User Agreement and Privacy Policy.
SlideShare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our Privacy Policy and User Agreement for details.
Successfully reported this slideshow.
Activate your 14 day free trial to unlock unlimited reading.
21.
Model
View Controller
① GUIイベント
③ 描画依頼
④ データ取り出し
② モデル操作・更新
データの保持
&ビジネスロジック
(WEB-APIを発行するのは
Model)
22.
Model
View Controller
① GUIイベント
③ 描画依頼
Fragment
(or Activity)
レイアウトXML
View、ViewGroupクラス
③④は
Controllerを経由する
Androidの場合
② モデル操作・更新
データの保持
&ビジネスロジック
(WEB-APIを発行するのは
Model)
④ データ取り出し
普通のJavaクラス
23.
Model
View Controller
① GUIイベント
② モデル操作・更新
③ 描画依頼
Fragment
(or Activity)
普通のJavaクラス
③④は
Controllerを経由する
Androidの場合
Event Bus
ORM
Retrofit 等
Butter Knife
データの保持
&ビジネスロジック
(WEB-APIを発行するのは
Model)
レイアウトXML
View、ViewGroupクラス
④ データ取り出し
24.
Model (普通のJavaクラス)
・データの保持(変数)とデータの操作メソッド
・Controller からこちらに追い出す
・イベント取得やViewパーツの操作は
しない
25.
Fragment
Fragment
Fragment
Model
長寿
短命
インスタンスの参照
WEB-APIの発行など
複数の画面で使いまわす場合や、時間が
かかる処理をある場合
52.
・レイアウトに関する固定値は、教科書
どおり res フォルダ配下の XML で管理する
・ロジックに関するものは普通に固定値
クラスを作って public static final で定義する
・その Fragment でのみ利用するものはその Fragment
に書いてもよいと思う
固定値