Is Activity God? ~ The MVP Architecture ~

Is Activity God? ~ The MVP Architecture ~

About MVP Architecture, The Difference between MVC and MVP, and Pros/Cons of MVP

3b36493b4296ebeb219bcd3ffab3aa2b?s=128

Kenju Wagatsuma

December 16, 2015
Tweet

Transcript

  1. Is Activity God? Kenju Wagatsuma

  2. Agenda: -> ❖ 1m : Story Behind ❖ 3m :

    What and Why? ❖ 1m : Conclusion
  3. /** * Introduce Myself * * @author me */

  4. “me” = { “name” : “Kenju Wagatsuma ( KJ )”,

    “company” : “Recruit Technologies Co.,LTD.”, “profession” : “Android Development”, “favs” : { 'Music' : ‘Stevie Wonder', 'Hobby' : ‘Acoustic Guitar & Singing’, 'Sport' : 'Rugby' } }
  5. /** * Story Behind * * @author me */

  6. To Do MVP -> MVC? -> What? -> Why? Not

    To Do MVVM DDD Sample Code
  7. Activity -> UI + Logic :( -> Multiple Threads :(

    -> Spaghetti :( -> Testing is hard :( Other Classes
  8. MVP? φχιϨΦΠγΠϊ?

  9. /** * What MVP? * * @author me */

  10. http://www.techyourchance.com/model-view-controller-mvc-and-model-view-presenter-mvp-architectural-patterns-in-android-part-1/ No Communication

  11. Entity / Data ( e.g. JSON, SQL ) UseCase /

    Business Logic Presenter / Adapter View / UI Threads
  12. Entity / Data ( e.g. JSON, SQL ) UseCase /

    Business Logic Presenter / Adapter View / UI Threads X X X
  13. /** * Why MVP? * * @author me */

  14. Why? - Pros, Cons ❖ Maintainability ❖ Testability ❖ Information

    Hiding
  15. Why? - Pros, Cons ❖ Redundancy ❖ Takes Time

  16. /** * Conclusion * * @author me */

  17. No Silver Bullet ❖ MVP ❖ is just one of

    possibilities and not a perfect solution ❖ could be mixed w/ other solutions
  18. /** * Appendix * */

  19. Blog “Architecting Android… The clean way?” @see http://fernandocejas.com/2014/09/03/ architecting-android-the-clean-way/

  20. Blog “M — Model in MVC, MVP, MVVC in Android” @see https://medium.com/@artem_zin/m-

    model-from-mvc-mvp-in-android-flow- and-mortar-bd1e50c45395#.5e525edu1
  21. Github Wiki “Introduction to Model View Presenter on Android” @see

    https://github.com/konmik/ konmik.github.io/wiki/Introduction- to-Model-View-Presenter-on-Android
  22. Blog “AndroidͰ͸ MVCΑΓMVPͷํ͕͍͍͔΋͠Εͳ͍” @see http://konifar.hatenablog.com/entry/ 2015/04/17/010606

  23. Blog “͜Ε͔Βͷʮઃܭʯͷ࿩Λ͠Α͏” @see http://tech.recruit-mp.co.jp/mobile/ android-architecture/

  24. /** * Happy Coding! * */

  25. /** * Contacts * */

  26. “contact” = { “Twitter” : “@kenjuwagatsuma”, “GitHub” : “https://github.com/KENJU”, “Blog”

    : “https://medium.com/@kenjuwagatsuma” }