Weitere ähnliche Inhalte
Ähnlich wie Mvp in practice (17)
Mvp in practice
- 2. About me
Android developer 2 years+
Name: 洪彥彬
Gitbook:
https://www.gitbook.com/book/hungyanbin/android-un
it-test/
Github: https://github.com/hungyanbin
- 7. I hope you know...
1. Unit Test
2. MVP
3. Object-oriented programming
- 9. Contract
1. 在實作前就先要定義好 → DIP
2. 定義 View 跟 Presenter 職責
3. Contract 應該要看不到 Android framework 的元件(Bundle, Context)
4. 有關 Android Framework UI 元件,都在 View 實作中解決
5. 有關 Android Framework 非 UI 元件,都在 Model 實作中解決
- 10. Sample : Login Page
Spec :
1. 可以輸入帳號
2. 可以輸入密碼
3. 點擊登入按鈕後,如果帳密正確,顯示登入成功
4. 點擊登入按鈕後,如果帳密錯誤,顯示登入失敗
- 25. Bad smell
1. 透露實作細節
2. 違反DIP(Dependency Inversion Principle)
3. 依然沒有與 Android Framework(StringRes) 分開,而且使用integer來代表字串
不太合理
4. 滿滿的技術債