is activity god? ~ the mvp architecture ~

26
Is Activity God? Kenju Wagatsuma

Upload: ken-william

Post on 07-Jan-2017

9.347 views

Category:

Software


1 download

TRANSCRIPT

Is Activity God?

Kenju Wagatsuma

Agenda: ->

❖ 1m : Story Behind ❖ 3m : What and Why? ❖ 1m : Conclusion

/** * Introduce Myself * * @author me */

“me” = { “name” : “Kenju Wagatsuma ( KJ )”, “company” : “Recruit Technologies Co.,LTD.”, “profession” : “Android Development”, “favs” : { 'Music' : ‘Stevie Wonder', 'Hobby' : ‘Acoustic Guitar & Singing’, 'Sport' : 'Rugby' } }

/** * Story Behind * * @author me */

To Do

MVP -> MVC? -> What? -> Why?

Not To Do

MVVM DDD

Sample Code

Activity -> UI + Logic :( -> Multiple Threads :( -> Spaghetti :( -> Testing is hard :(

Other Classes

MVP?

ナニソレオイシイノ?

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

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

No Communication

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

UseCase / Business Logic

Presenter / Adapter

View / UI Threads

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

UseCase / Business Logic

Presenter / Adapter

View / UI Threads

X

X

X

/** * Why MVP? * * @author me */

Why? - Pros, Cons

❖ Maintainability ❖ Testability ❖ Information Hiding

Why? - Pros, Cons

❖ Redundancy ❖ Takes Time

/** * Conclusion * * @author me */

No Silver Bullet❖ MVP ❖ is just one of possibilities

and not a perfect solution ❖ could be mixed w/ other

solutions

/** * Appendix * */

Blog

“Architecting Android… The clean way?”

@see http://fernandocejas.com/2014/09/03/architecting-android-the-clean-way/

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

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

Blog

“Androidでは

MVCよりMVPの方がいいかもしれない”

@see http://konifar.hatenablog.com/entry/2015/04/17/010606

Blog

“これからの「設計」の話をしよう”

@see http://tech.recruit-mp.co.jp/mobile/android-architecture/

/** * Happy Coding! * */

/** * Contacts * */

“contact” = {

“Twitter” : “@kenjuwagatsuma”,

“GitHub” : “https://github.com/KENJU”,

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

}