SlideShare a Scribd company logo
1 of 32
Download to read offline
導入反應式編程的⼼心路路歷程
Android Developer - PicCollage
Prada
Why reactive programing matter, and how PicCollage adaptive it.
Why Reactive
Programming matters?
https://www.youtube.com/watch?v=v68ppDlvHqs
1. Deal with Threading right is matters
2. Architecture also need to be reactive.
Old World
You Code shouldn’t like this
Our World is shifting
Blocking -> Non-Blocking
Computer -> User
Developer suffering
from Threading
I was join PicCollage in 2013
we have over 30 Customized AsyncTask Classes
Deferred-Promise Pattern
is Popular
we tried jDeferred and Bolts-Framework
https://github.com/jdeferred/jdeferred
https://github.com/BoltsFramework
We went to Android SF
Meetup in 2016
https://tech.pic-collage.com/android-meetup-in-san-fransisco-e1e8dde1554c
Implement thread in
RxJava
https://tech.pic-collage.com/android-meetup-in-san-fransisco-e1e8dde1554c
https://youtu.be/XLH2v9deew0?t=4m51s
Asynchronous Ideas
1. Explicit execution
2. Easy thread management
3. Easily transformable
4. As few side effect as possible
5. Cancelation
Architecture also need
to be reactive
Trending : Make Model/
State be reactive
Google try to move to
MVVM pattern
https://developer.android.com/topic/libraries/data-binding/index.html
Android Architecture
Component
https://developer.android.com/topic/libraries/architecture/index.html
Trending : isolated Android
framework dependency
Android Dev Hates
Activity/Fragment LifeCycle
Your Code might looks like
MyActivity.java
Takes View’s Input
Update Views
Control Logic
Data/Model
MVC⼀一家親
Your Code might looks like
MyActivity.java
Takes View’s Input
Update Views
Control Logic
VC⼀一家親
MyContentProvider.java
Data/Model
Model-View-Presenter
MyActivity.java
Takes View’s Input
Update Views
MyContentProvider.java
Data
MyPresenter.java
Control Logic
IView.java IPresenter.java
Trending : Controller
need to be reactive
You might want your
controller looks like
In the end, Your code will be
https://www.youtube.com/watch?v=0IKHxjkgop4
Adoption steps from
PicCollage
1. UI interaction
2. Threading mechanism
3. Make Data Layer API be reactive
4. Make Controller be reactive
UI interaction
https://github.com/JakeWharton/RxBinding
Threading mechanism
Before
After
Data Layer API be reactive
Note : some case you need to use Subject to achieve this goal
https://github.com/ReactiveX/RxJava/wiki/Subject
Controller be reactive
Take away
1. Learn from web developers(Flux, Redux, MVI)
2. Review your threading code
3. Reactive Programming has high learning curve
4. Follow our adoption steps
Thanks, Question?
Reference
Intro to RxJava/ Christina Lee
https://www.youtube.com/watch?v=XLH2v9deew0
Dynamics of change: why reactivity matters/ Andre Staltz
https://www.youtube.com/watch?v=v68ppDlvHqs
Managing State with RxJava/ Jake Wharton
https://www.youtube.com/watch?v=0IKHxjkgop4

More Related Content

What's hot

What's hot (15)

Users don't want features, they want better content – Pantelis Korovilas, Hop...
Users don't want features, they want better content – Pantelis Korovilas, Hop...Users don't want features, they want better content – Pantelis Korovilas, Hop...
Users don't want features, they want better content – Pantelis Korovilas, Hop...
 
Y U NO CRAFTSMAN
Y U NO CRAFTSMANY U NO CRAFTSMAN
Y U NO CRAFTSMAN
 
Fastlane for Androidによる継続的デリバリー
Fastlane for Androidによる継続的デリバリーFastlane for Androidによる継続的デリバリー
Fastlane for Androidによる継続的デリバリー
 
Introduction to Django
Introduction to DjangoIntroduction to Django
Introduction to Django
 
Git of Parts
Git of PartsGit of Parts
Git of Parts
 
Bootiful Development with Spring Boot and React - GIDS 2019
Bootiful Development with Spring Boot and React - GIDS 2019Bootiful Development with Spring Boot and React - GIDS 2019
Bootiful Development with Spring Boot and React - GIDS 2019
 
Librerías Opensoure de Square
Librerías Opensoure de Square Librerías Opensoure de Square
Librerías Opensoure de Square
 
From DevOps to GitOps with GitLab
From DevOps to GitOps with GitLabFrom DevOps to GitOps with GitLab
From DevOps to GitOps with GitLab
 
Automating with operators - FossAsia Summit 2019
Automating with operators - FossAsia Summit 2019Automating with operators - FossAsia Summit 2019
Automating with operators - FossAsia Summit 2019
 
Android is going to Go! Android and Golang
Android is going to Go! Android and GolangAndroid is going to Go! Android and Golang
Android is going to Go! Android and Golang
 
Develop Android app using Golang
Develop Android app using GolangDevelop Android app using Golang
Develop Android app using Golang
 
두 번째 startlink.live: 장홍준 (hongjun7) - Teamwork in Programming Contests
두 번째 startlink.live: 장홍준 (hongjun7) - Teamwork in Programming Contests두 번째 startlink.live: 장홍준 (hongjun7) - Teamwork in Programming Contests
두 번째 startlink.live: 장홍준 (hongjun7) - Teamwork in Programming Contests
 
Porting golang development environment developed with golang
Porting golang development environment developed with golangPorting golang development environment developed with golang
Porting golang development environment developed with golang
 
An introduction to_golang.avi
An introduction to_golang.aviAn introduction to_golang.avi
An introduction to_golang.avi
 
Griffon: Swing just got fun again
Griffon: Swing just got fun againGriffon: Swing just got fun again
Griffon: Swing just got fun again
 

Similar to Why reactive programing matter, and how PicCollage adaptive it.

Curious Coders Java Web Frameworks Comparison
Curious Coders Java Web Frameworks ComparisonCurious Coders Java Web Frameworks Comparison
Curious Coders Java Web Frameworks Comparison
Hamed Hatami
 

Similar to Why reactive programing matter, and how PicCollage adaptive it. (20)

Ionic - Revolutionizing Hybrid Mobile Application Development
Ionic - Revolutionizing Hybrid Mobile Application DevelopmentIonic - Revolutionizing Hybrid Mobile Application Development
Ionic - Revolutionizing Hybrid Mobile Application Development
 
Intro to Web Development from Bloc.io
Intro to Web Development from Bloc.ioIntro to Web Development from Bloc.io
Intro to Web Development from Bloc.io
 
The 10 Commandments For The Eager Developer
The 10 Commandments For The Eager DeveloperThe 10 Commandments For The Eager Developer
The 10 Commandments For The Eager Developer
 
Is Your App Hackable for droidcon Berlin 2015
Is Your App Hackable for droidcon Berlin 2015Is Your App Hackable for droidcon Berlin 2015
Is Your App Hackable for droidcon Berlin 2015
 
Pain Driven Development by Alexandr Sugak
Pain Driven Development by Alexandr SugakPain Driven Development by Alexandr Sugak
Pain Driven Development by Alexandr Sugak
 
Workshop: Introduction to Web Components & Polymer
Workshop: Introduction to Web Components & Polymer Workshop: Introduction to Web Components & Polymer
Workshop: Introduction to Web Components & Polymer
 
Agile software architecture
Agile software architectureAgile software architecture
Agile software architecture
 
FFWD.PRO - It's not you, It's me (or how to avoid being coupled with a Javasc...
FFWD.PRO - It's not you, It's me (or how to avoid being coupled with a Javasc...FFWD.PRO - It's not you, It's me (or how to avoid being coupled with a Javasc...
FFWD.PRO - It's not you, It's me (or how to avoid being coupled with a Javasc...
 
Matteo Manchi - React Native for multi-platform mobile applications - Codemot...
Matteo Manchi - React Native for multi-platform mobile applications - Codemot...Matteo Manchi - React Native for multi-platform mobile applications - Codemot...
Matteo Manchi - React Native for multi-platform mobile applications - Codemot...
 
Introduzione a React Native - Facebook Developer Circle Rome
Introduzione a React Native - Facebook Developer Circle RomeIntroduzione a React Native - Facebook Developer Circle Rome
Introduzione a React Native - Facebook Developer Circle Rome
 
Work with Developers for Fun and Progress - AppSec California
Work with Developers for Fun and Progress - AppSec CaliforniaWork with Developers for Fun and Progress - AppSec California
Work with Developers for Fun and Progress - AppSec California
 
JsDay - It's not you, It's me (or how to avoid being coupled with a Javascrip...
JsDay - It's not you, It's me (or how to avoid being coupled with a Javascrip...JsDay - It's not you, It's me (or how to avoid being coupled with a Javascrip...
JsDay - It's not you, It's me (or how to avoid being coupled with a Javascrip...
 
[Phpcamp]Shindig An OpenSocial container
[Phpcamp]Shindig An OpenSocial container[Phpcamp]Shindig An OpenSocial container
[Phpcamp]Shindig An OpenSocial container
 
Pwning mobile apps without root or jailbreak
Pwning mobile apps without root or jailbreakPwning mobile apps without root or jailbreak
Pwning mobile apps without root or jailbreak
 
Quick prototyping apps using JS - Ciklum, Vinnitsa
Quick prototyping apps using JS - Ciklum, VinnitsaQuick prototyping apps using JS - Ciklum, Vinnitsa
Quick prototyping apps using JS - Ciklum, Vinnitsa
 
Angular 2 : learn TypeScript already with Angular 1
Angular 2 : learn TypeScript already with Angular 1Angular 2 : learn TypeScript already with Angular 1
Angular 2 : learn TypeScript already with Angular 1
 
Activity 5 a little scratch and squeak
Activity 5 a little scratch and squeakActivity 5 a little scratch and squeak
Activity 5 a little scratch and squeak
 
From Software Engineering To Machine Learning
From Software Engineering To Machine LearningFrom Software Engineering To Machine Learning
From Software Engineering To Machine Learning
 
Curious Coders Java Web Frameworks Comparison
Curious Coders Java Web Frameworks ComparisonCurious Coders Java Web Frameworks Comparison
Curious Coders Java Web Frameworks Comparison
 
Web Development in Django
Web Development in DjangoWeb Development in Django
Web Development in Django
 

More from PRADA Hsiung

More from PRADA Hsiung (20)

Dive into Kotlin Delegation implementation to solve the obfuscation issue
Dive into Kotlin Delegation implementation to solve the obfuscation issue Dive into Kotlin Delegation implementation to solve the obfuscation issue
Dive into Kotlin Delegation implementation to solve the obfuscation issue
 
U/T/B-Driven Development
U/T/B-Driven Development U/T/B-Driven Development
U/T/B-Driven Development
 
Job-to-be-done theory to practice : Ch4 Process
Job-to-be-done theory to practice : Ch4 ProcessJob-to-be-done theory to practice : Ch4 Process
Job-to-be-done theory to practice : Ch4 Process
 
Introduce Flutter Development
Introduce Flutter DevelopmentIntroduce Flutter Development
Introduce Flutter Development
 
JTBD case study : Uber Rider App
JTBD case study : Uber Rider AppJTBD case study : Uber Rider App
JTBD case study : Uber Rider App
 
20180124 android taipei_arinterface
20180124 android taipei_arinterface20180124 android taipei_arinterface
20180124 android taipei_arinterface
 
JSON's big problem android_taipei_201709
JSON's big problem android_taipei_201709JSON's big problem android_taipei_201709
JSON's big problem android_taipei_201709
 
ARText in Cocoaheads Taipei 201709
ARText in Cocoaheads Taipei 201709ARText in Cocoaheads Taipei 201709
ARText in Cocoaheads Taipei 201709
 
PicCollage - modules map
PicCollage - modules mapPicCollage - modules map
PicCollage - modules map
 
COSCUP 2017 FACE OFF
COSCUP 2017 FACE OFFCOSCUP 2017 FACE OFF
COSCUP 2017 FACE OFF
 
IO17就是講義氣
IO17就是講義氣IO17就是講義氣
IO17就是講義氣
 
Firebase analytics event_201607
Firebase analytics event_201607Firebase analytics event_201607
Firebase analytics event_201607
 
臉 - The Face Detection Functions on Android
臉 - The Face Detection Functions on Android臉 - The Face Detection Functions on Android
臉 - The Face Detection Functions on Android
 
20150423 Android Taipei : 祖克伯F8的奇幻之旅
20150423 Android Taipei : 祖克伯F8的奇幻之旅20150423 Android Taipei : 祖克伯F8的奇幻之旅
20150423 Android Taipei : 祖克伯F8的奇幻之旅
 
網碼邊界(Edge of Network Libs)
網碼邊界(Edge of Network Libs)網碼邊界(Edge of Network Libs)
網碼邊界(Edge of Network Libs)
 
那些年,我們一起玩的萬花筒(Kaliedoscopic)
那些年,我們一起玩的萬花筒(Kaliedoscopic)那些年,我們一起玩的萬花筒(Kaliedoscopic)
那些年,我們一起玩的萬花筒(Kaliedoscopic)
 
安小姐與詹先生的邂逅 Android + Jenkins
安小姐與詹先生的邂逅 Android + Jenkins安小姐與詹先生的邂逅 Android + Jenkins
安小姐與詹先生的邂逅 Android + Jenkins
 
期末專題報告:嵌入式系統之影像處理器
期末專題報告:嵌入式系統之影像處理器期末專題報告:嵌入式系統之影像處理器
期末專題報告:嵌入式系統之影像處理器
 
Continues integration development
Continues integration development Continues integration development
Continues integration development
 
交點#3 我的比賽人生
交點#3 我的比賽人生交點#3 我的比賽人生
交點#3 我的比賽人生
 

Recently uploaded

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Recently uploaded (20)

Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 

Why reactive programing matter, and how PicCollage adaptive it.