Future Architecture MVP+C
WISNU KURNIAWAN
● Chat Widget
● GGWP
● Prism Mobile
● Prism Android SDK
● Selly
● ...
MVP + C in
Prism Mobile
MVP+C. Background
Programming, at its core, is about data transformation. And the case for
most mobile applications, it is about data transformation, data composition,
and UI presentation
RxJava to the rescue!
MVP+C. What is the C?
MVP+C. What is the C?
C is for Composer.
MVP+C. What is the C?
C is for Composer.
Composer is a class that has lifecycle (activity, fragment, dialog, etc) in
order to compose the stream of a process.
1
RxJava for compose stream
2 Dagger for Dependency Injection
3 Data source and Error handling
RxJava
RxNavi by Trello
https://github.com/trello/navi
RxJava
Do not use Rx if there is no “event”.
Dagger
Dagger
Make your class loose coupling between other class.
Dagger
Make easy to create unit test
Data source
&
Error handling
Data source
● Server
○ Handle the communication to server using Retrofit
○ Every request call to server MUST handle error
● Local
○ Save data into local
■ Shared Preference
■ DBFlow
Error handling
Railway Oriented Programming
Error handling
● Kinds of error:
○ NetworkError
○ NoInternetError
○ TokenExpiredError
○ UnknownError
○ ResultEmptyError
● All Error passed to composer
NetworkError
NoInternetError
TokenExpiredError
UnknownError
Usage
ResultEmptyError
Usage
Handled in Composer
Links
➔ https://github.com/trello/navi
➔ http://konmik.com/post/when_to_not_use_rxjava
➔ http://www.javacreed.com/why-should-we-use-dependency-injection
➔ https://google.github.io/dagger
➔ https://github.com/Raizlabs/DBFlow
➔ http://square.github.io/retrofit
➔ https://github.com/wisnukurniawan/Kovie -> Project Example
➔ https://github.com/elsennov/recipee -> Project Example
Thank you.
Telegram : @Wisnukurn
Medium : https://medium.com/@wisnukurniawan
Github : https://github.com/wisnukurniawan

Mode View Presenter Composer Architecture