SlideShare uma empresa Scribd logo
1 de 43
Baixar para ler offline
2015/11/17
@kengoScal
Android Clean Architecture
for
Dummies
About Me
2
Self Introduction
name: Kengo Suzuki
twitter: @kengoScal
3
2011∼2014:Security Analyst
2014年11月: Joined MoneyForward
2014年11月∼2015年01月: iOS
2015年02月∼08月:Android
2015年09月∼10月 : Security Architect
2015年11月 : Security Architect/Management + Android
4
In Charge of New Android App!
Android Clean Architecture
5
What is it & Why using it?
6
What is it & Why using it?
7
Not Today.
Plenty of Good Entries(with source codes)
8
• English
• Architecting Android…The Clean Way?
• Clean Android Architecture
• MVP for Android: how to organize presentation
layer
• Japanese
• AndroidオールスターズでClean Architectureについて発
表してきた
• これからの設計の話をしよう
• AndroidではMVCよりMVPの方がいいかもしれない
Plenty of Good Entries(with source codes)
9
• English
• Architecting Android…The Clean Way?
• Clean Android Architecture
• MVP for Android: how to organize presentation
layer
• Japanese
• AndroidオールスターズでClean Architectureについ
て発表してきた
• これからの設計の話をしよう
• AndroidではMVCよりMVPの方がいいかもしれない
Big Picture
Source Code
Roles
Big Picture
Roles
Presenter
Right off the Bat?
10
訳: すぐに/直ちに
Need Endurance!
11
• Codes aren t self explanatory
• Lack of experience in using core liibraries could
be pain
• Don t know what goes where.
12
Architecure is About Intent, not Frameworks
13
by Robert Cecil Martin
With the Hope, no one gives up architecting
14
How to use it (Tutorial)
15
Primitive App
16
• Single Activity
• Single List View
• Horizontally aligned texts
• Fab
• click and fetch data
• Fetch MusicList(data)
• by Retrofit
• freemusicarchive.org
• DI and EventHub
• Under Construction
Click And Fetch Data Tutorial
17
The Goal
18
• Click Fab
• Run Retrofit to fetch data
• Not considering data response
19
What We Will Implement
• reference
• Architecting Android…The Clean Way?:
• これからの設計の話をしよう
Thing You Need To Implement
20
• MainActivity
• MusicListPresenter
• MusicListUseCase
• MusicListUseCaseImpl
• MusicListRepository
• MusicListRepositoryImpl
• MusicListEntity
Data
Domain
Presentation
Thing You Need To Implement
21
• MainActivity
• MusicListAdapter
• MusicListPresenter
• MusicListUseCase
• MusicListUseCaseImpl
• MusicListRepository
• MusicListRepositoryImpl
• MusicListEntity
Presentation - UserAction
22
• Main Activity & MusicListAdapter
• Render List View attaching adapter
• Initialize followings
• repository, usecase, presenter
• Pass FAB clicked event along with Main Thread Info
to Presenter
• MusicListPresenter
• Receive FAB clicked event from View
• Execute MusicListUseCase(Imp) Job
• Pass thread info to MusicListUseCas(Imp)
23
What We Just Implemented
• reference
• Architecting Android…The Clean Way?:
• これからの設計の話をしよう
Domain - User Action to Data Interface
24
• MusicUseCase
• Provide interface between Domain Layer &
Presentation Layer
• MusicUseCaseImp
• Ask MusicListRepository(Imp) for API(External
Resource)
• MusicListRepository
• Provide interface between Domain Layer &
Data Layer
25
What We Just Implemented
• reference
• Architecting Android…The Clean Way?:
• これからの設計の話をしよう
Data - Data Interface to DataSource
26
• MusicListRepositoryImp
• To Fetch external Data
• Declare and Execute Retrofit Http Client
• GET http://freemusicarchive.org/api?
key={key}
• MusicListEntity
• Parse Response and map to domain/model
• gson will handle it.
27
What We Just Implemented
• reference
• Architecting Android…The Clean Way?:
• これからの設計の話をしよう
That s it for Fetching Data
28
Now we want to Reflect Data
Reflect Data to View Tutorial
29
The Goal
30
• Pass back data just fetched
• Update View
31
What We Will Implement
• reference
• Architecting Android…The Clean Way?:
• これからの設計の話をしよう
Thing You Need To Implement
32
• MusicListRepository#MusicListFetchCallback
• MusicListUseCaseImpl
• MusicListUseCase#MusicListUseCaseCallback
• MusicListPresenter
• MusicListPresenter#MusicListViewCallback
• MainActivity
Presentation
Domain
Data
Thing You Need To Implement
33
• MusicListRepository#MusicListFetchCallback
• MusicListUseCaseImpl
• MusicListUseCase#MusicListUseCaseCallback
• MusicListPresenter
• MusicListPresenter#MusicListViewCallback
• MainActivity
Domain - Passing Data to User Interface
34
• MusicListRepository#MusicListFetchCallback
• MusicListUseCaseImpl
• Implement MusicListFetchCallback
• So that Main Threat can receive runnable
with command with fetched data
• MusicListUseCase#MusicListUseCaseCallback
• MusicListPresenter
• MusicListPresenter#MusicListViewCallback
• MainActivity
35
What We Just Implemented
• reference
• Architecting Android…The Clean Way?:
• これからの設計の話をしよう
Presentation - Updating View
36
• MusicListUseCase#MusicListUseCaseCallback
• MusicListPresenter#MusicListViewCallback
• MusicListPresenter
• Implement MusicListUseCaseCallback
• Execute methods in MusicListViewCallback
• MainActivity
• Implement MusicListViewCallback
• So that User Case can pass fetched data
• So that Activity can update adapter data
37
What We Just Implemented
• reference
• Architecting Android…The Clean Way?:
• これからの設計の話をしよう
That s it!
38
Lots of Room for Improvement
39
• Callback Repetition is quite Ugly
• Many Reinvent Wheel
• Not using Dagger, RxJava
• Not a big fun of passing thread around
• Tutorial itself wasn t thoroughly covered
Still, Worthwhile
40
Especially, in the team
Enjoy Clean Architecting!
41
Thank you!
References
43
• English
• Architecting Android…The Clean Way?: http://fernandocejas.com/
2014/09/03/architecting-android-the-clean-way/
• Clean Android Architecture: https://speakerdeck.com/richk/clean-
android-architecture
• MVP for Android: how to organize presentation layer: http://
antonioleiva.com/mvp-android/
• Japanese
• AndroidオールスターズでClean Architectureについて発表してきた: http://
tomoima525.hatenablog.com/entry/2015/08/13/190731
• これからの設計の話をしよう: http://www.slideshare.net/
shinnosukekugimiya/ss-50705888
• AndroidではMVCよりMVPの方がいいかもしれない: http://
konifar.hatenablog.com/entry/2015/04/17/010606

Mais conteúdo relacionado

Mais procurados

Microservice Stategies - Scaling your API design workflow
Microservice Stategies - Scaling your API design workflowMicroservice Stategies - Scaling your API design workflow
Microservice Stategies - Scaling your API design workflowJakub Nesetril
 
Into to GraphQL
Into to GraphQLInto to GraphQL
Into to GraphQLshobot
 
apidays LIVE Hong Kong 2021 - Less Data is More by Damir Svrtan, Netflix
apidays LIVE Hong Kong 2021 - Less Data is More by Damir Svrtan, Netflixapidays LIVE Hong Kong 2021 - Less Data is More by Damir Svrtan, Netflix
apidays LIVE Hong Kong 2021 - Less Data is More by Damir Svrtan, Netflixapidays
 
Infinum Android Talks #13 - Developing Android Apps Like Navy Seals by Ivan Kušt
Infinum Android Talks #13 - Developing Android Apps Like Navy Seals by Ivan KuštInfinum Android Talks #13 - Developing Android Apps Like Navy Seals by Ivan Kušt
Infinum Android Talks #13 - Developing Android Apps Like Navy Seals by Ivan KuštInfinum
 
API-first development
API-first developmentAPI-first development
API-first developmentVasco Veloso
 
Standing out as a new grad candidate
Standing out as a new grad candidateStanding out as a new grad candidate
Standing out as a new grad candidateSashko Stubailo
 
apidays LIVE London 2021 - API Horror Stories from an Unnamed Coworking Compa...
apidays LIVE London 2021 - API Horror Stories from an Unnamed Coworking Compa...apidays LIVE London 2021 - API Horror Stories from an Unnamed Coworking Compa...
apidays LIVE London 2021 - API Horror Stories from an Unnamed Coworking Compa...apidays
 
Taking Control of your Data with GraphQL
Taking Control of your Data with GraphQLTaking Control of your Data with GraphQL
Taking Control of your Data with GraphQLVinci Rufus
 
How to GraphQL
How to GraphQLHow to GraphQL
How to GraphQLTomasz Bak
 
Mikki Mesfin's Resume
Mikki Mesfin's ResumeMikki Mesfin's Resume
Mikki Mesfin's ResumeMikki Mesfin
 
Blood, sweat, and creating an API handbook
Blood, sweat, and creating an API handbookBlood, sweat, and creating an API handbook
Blood, sweat, and creating an API handbookPronovix
 
apidays LIVE Australia 2021 - Designing APIs: Just Enough is Perfect! by Dami...
apidays LIVE Australia 2021 - Designing APIs: Just Enough is Perfect! by Dami...apidays LIVE Australia 2021 - Designing APIs: Just Enough is Perfect! by Dami...
apidays LIVE Australia 2021 - Designing APIs: Just Enough is Perfect! by Dami...apidays
 
SauceCon19: Fashionable XCUITest for iOS App
SauceCon19: Fashionable XCUITest for iOS App SauceCon19: Fashionable XCUITest for iOS App
SauceCon19: Fashionable XCUITest for iOS App Shashikant Jagtap
 
GraphQL vs BFF: A critical perspective
GraphQL vs BFF: A critical perspectiveGraphQL vs BFF: A critical perspective
GraphQL vs BFF: A critical perspectivePronovix
 
API first approach for frontend developers
API first approach for frontend developersAPI first approach for frontend developers
API first approach for frontend developersFDConf
 
Writing Slack Bots in JavaScript
Writing Slack Bots in JavaScriptWriting Slack Bots in JavaScript
Writing Slack Bots in JavaScriptNiklas Heidloff
 
[CocoaHeads Tricity] Andrzej Dąbrowski - Dependency injection and testable ar...
[CocoaHeads Tricity] Andrzej Dąbrowski - Dependency injection and testable ar...[CocoaHeads Tricity] Andrzej Dąbrowski - Dependency injection and testable ar...
[CocoaHeads Tricity] Andrzej Dąbrowski - Dependency injection and testable ar...CocoaHeads Tricity
 
Pure APIs: Development workflows for successful API integrations
Pure APIs: Development workflows for successful API integrationsPure APIs: Development workflows for successful API integrations
Pure APIs: Development workflows for successful API integrationsJosé Haro Peralta
 
Open Event API
Open Event APIOpen Event API
Open Event APIAvi Aryan
 

Mais procurados (20)

Microservice Stategies - Scaling your API design workflow
Microservice Stategies - Scaling your API design workflowMicroservice Stategies - Scaling your API design workflow
Microservice Stategies - Scaling your API design workflow
 
Into to GraphQL
Into to GraphQLInto to GraphQL
Into to GraphQL
 
apidays LIVE Hong Kong 2021 - Less Data is More by Damir Svrtan, Netflix
apidays LIVE Hong Kong 2021 - Less Data is More by Damir Svrtan, Netflixapidays LIVE Hong Kong 2021 - Less Data is More by Damir Svrtan, Netflix
apidays LIVE Hong Kong 2021 - Less Data is More by Damir Svrtan, Netflix
 
Infinum Android Talks #13 - Developing Android Apps Like Navy Seals by Ivan Kušt
Infinum Android Talks #13 - Developing Android Apps Like Navy Seals by Ivan KuštInfinum Android Talks #13 - Developing Android Apps Like Navy Seals by Ivan Kušt
Infinum Android Talks #13 - Developing Android Apps Like Navy Seals by Ivan Kušt
 
API-first development
API-first developmentAPI-first development
API-first development
 
Standing out as a new grad candidate
Standing out as a new grad candidateStanding out as a new grad candidate
Standing out as a new grad candidate
 
apidays LIVE London 2021 - API Horror Stories from an Unnamed Coworking Compa...
apidays LIVE London 2021 - API Horror Stories from an Unnamed Coworking Compa...apidays LIVE London 2021 - API Horror Stories from an Unnamed Coworking Compa...
apidays LIVE London 2021 - API Horror Stories from an Unnamed Coworking Compa...
 
Taking Control of your Data with GraphQL
Taking Control of your Data with GraphQLTaking Control of your Data with GraphQL
Taking Control of your Data with GraphQL
 
How to GraphQL
How to GraphQLHow to GraphQL
How to GraphQL
 
Mikki Mesfin's Resume
Mikki Mesfin's ResumeMikki Mesfin's Resume
Mikki Mesfin's Resume
 
Blood, sweat, and creating an API handbook
Blood, sweat, and creating an API handbookBlood, sweat, and creating an API handbook
Blood, sweat, and creating an API handbook
 
apidays LIVE Australia 2021 - Designing APIs: Just Enough is Perfect! by Dami...
apidays LIVE Australia 2021 - Designing APIs: Just Enough is Perfect! by Dami...apidays LIVE Australia 2021 - Designing APIs: Just Enough is Perfect! by Dami...
apidays LIVE Australia 2021 - Designing APIs: Just Enough is Perfect! by Dami...
 
Api First Design
Api First DesignApi First Design
Api First Design
 
SauceCon19: Fashionable XCUITest for iOS App
SauceCon19: Fashionable XCUITest for iOS App SauceCon19: Fashionable XCUITest for iOS App
SauceCon19: Fashionable XCUITest for iOS App
 
GraphQL vs BFF: A critical perspective
GraphQL vs BFF: A critical perspectiveGraphQL vs BFF: A critical perspective
GraphQL vs BFF: A critical perspective
 
API first approach for frontend developers
API first approach for frontend developersAPI first approach for frontend developers
API first approach for frontend developers
 
Writing Slack Bots in JavaScript
Writing Slack Bots in JavaScriptWriting Slack Bots in JavaScript
Writing Slack Bots in JavaScript
 
[CocoaHeads Tricity] Andrzej Dąbrowski - Dependency injection and testable ar...
[CocoaHeads Tricity] Andrzej Dąbrowski - Dependency injection and testable ar...[CocoaHeads Tricity] Andrzej Dąbrowski - Dependency injection and testable ar...
[CocoaHeads Tricity] Andrzej Dąbrowski - Dependency injection and testable ar...
 
Pure APIs: Development workflows for successful API integrations
Pure APIs: Development workflows for successful API integrationsPure APIs: Development workflows for successful API integrations
Pure APIs: Development workflows for successful API integrations
 
Open Event API
Open Event APIOpen Event API
Open Event API
 

Destaque

Clean architecture: Android
Clean architecture: AndroidClean architecture: Android
Clean architecture: Androidintive
 
Clean architecture on android
Clean architecture on androidClean architecture on android
Clean architecture on androidBenjamin Cheng
 
Android cleanarchitecture
Android cleanarchitectureAndroid cleanarchitecture
Android cleanarchitectureTomoaki Imai
 
Clean Architecture
Clean ArchitectureClean Architecture
Clean ArchitectureBadoo
 
Design pattern in android
Design pattern in androidDesign pattern in android
Design pattern in androidJay Kumarr
 
Is Activity God? ~ The MVP Architecture ~
Is Activity God? ~ The MVP Architecture ~Is Activity God? ~ The MVP Architecture ~
Is Activity God? ~ The MVP Architecture ~Ken William
 
Introducing Clean Architecture
Introducing Clean ArchitectureIntroducing Clean Architecture
Introducing Clean ArchitectureRoc Boronat
 
Clean architecture
Clean architectureClean architecture
Clean architectureandbed
 
Android Design Principles and Popular Patterns
Android Design Principles and Popular PatternsAndroid Design Principles and Popular Patterns
Android Design Principles and Popular PatternsFaiz Malkani
 
Android DevConference - Android Clean Architecture
Android DevConference - Android Clean ArchitectureAndroid DevConference - Android Clean Architecture
Android DevConference - Android Clean ArchitectureiMasters
 
Lightning Talk - Clean Architecture and Design
Lightning Talk - Clean Architecture and DesignLightning Talk - Clean Architecture and Design
Lightning Talk - Clean Architecture and DesignDeivison Sporteman
 
My way to clean android v2 English DroidCon Spain
My way to clean android v2 English DroidCon SpainMy way to clean android v2 English DroidCon Spain
My way to clean android v2 English DroidCon SpainChristian Panadero
 
Onion Architecture
Onion ArchitectureOnion Architecture
Onion Architecturematthidinger
 
World-Class Testing Development Pipeline for Android
 World-Class Testing Development Pipeline for Android World-Class Testing Development Pipeline for Android
World-Class Testing Development Pipeline for AndroidPedro Vicente Gómez Sánchez
 
Real Life Clean Architecture
Real Life Clean ArchitectureReal Life Clean Architecture
Real Life Clean ArchitectureMattia Battiston
 
Upload a screenshot to Slack
Upload a screenshot to SlackUpload a screenshot to Slack
Upload a screenshot to SlackShinobu Okano
 

Destaque (20)

Clean architecture: Android
Clean architecture: AndroidClean architecture: Android
Clean architecture: Android
 
Clean architecture on android
Clean architecture on androidClean architecture on android
Clean architecture on android
 
Effective Android UI - English
Effective Android UI - EnglishEffective Android UI - English
Effective Android UI - English
 
Android cleanarchitecture
Android cleanarchitectureAndroid cleanarchitecture
Android cleanarchitecture
 
Clean Architecture
Clean ArchitectureClean Architecture
Clean Architecture
 
Design pattern in android
Design pattern in androidDesign pattern in android
Design pattern in android
 
Is Activity God? ~ The MVP Architecture ~
Is Activity God? ~ The MVP Architecture ~Is Activity God? ~ The MVP Architecture ~
Is Activity God? ~ The MVP Architecture ~
 
Introducing Clean Architecture
Introducing Clean ArchitectureIntroducing Clean Architecture
Introducing Clean Architecture
 
Clean architecture
Clean architectureClean architecture
Clean architecture
 
Android Design Principles and Popular Patterns
Android Design Principles and Popular PatternsAndroid Design Principles and Popular Patterns
Android Design Principles and Popular Patterns
 
Karumi Dojo: Kata Maxibon
Karumi Dojo: Kata MaxibonKarumi Dojo: Kata Maxibon
Karumi Dojo: Kata Maxibon
 
Android DevConference - Android Clean Architecture
Android DevConference - Android Clean ArchitectureAndroid DevConference - Android Clean Architecture
Android DevConference - Android Clean Architecture
 
Lightning Talk - Clean Architecture and Design
Lightning Talk - Clean Architecture and DesignLightning Talk - Clean Architecture and Design
Lightning Talk - Clean Architecture and Design
 
Dependency injection on Android
Dependency injection on AndroidDependency injection on Android
Dependency injection on Android
 
My way to clean android v2 English DroidCon Spain
My way to clean android v2 English DroidCon SpainMy way to clean android v2 English DroidCon Spain
My way to clean android v2 English DroidCon Spain
 
Onion Architecture
Onion ArchitectureOnion Architecture
Onion Architecture
 
World-Class Testing Development Pipeline for Android
 World-Class Testing Development Pipeline for Android World-Class Testing Development Pipeline for Android
World-Class Testing Development Pipeline for Android
 
Real Life Clean Architecture
Real Life Clean ArchitectureReal Life Clean Architecture
Real Life Clean Architecture
 
Software Design patterns on Android English
Software Design patterns on Android EnglishSoftware Design patterns on Android English
Software Design patterns on Android English
 
Upload a screenshot to Slack
Upload a screenshot to SlackUpload a screenshot to Slack
Upload a screenshot to Slack
 

Semelhante a Android Clean Architecture for Dummies

Stuttgart Cloud-Native Landscape
Stuttgart Cloud-Native LandscapeStuttgart Cloud-Native Landscape
Stuttgart Cloud-Native LandscapeVMware Tanzu
 
Cloud-Native Roadshow - Landscape - San Francisco
Cloud-Native Roadshow - Landscape - San FranciscoCloud-Native Roadshow - Landscape - San Francisco
Cloud-Native Roadshow - Landscape - San FranciscoVMware Tanzu
 
Cloud-Native Roadshow - Landscape - Toronto
Cloud-Native Roadshow - Landscape - TorontoCloud-Native Roadshow - Landscape - Toronto
Cloud-Native Roadshow - Landscape - TorontoVMware Tanzu
 
Cloud-Native Roadshow - Landscape - St. Louis
Cloud-Native Roadshow - Landscape - St. LouisCloud-Native Roadshow - Landscape - St. Louis
Cloud-Native Roadshow - Landscape - St. LouisVMware Tanzu
 
Munich Cloud-Native Landscape
Munich Cloud-Native LandscapeMunich Cloud-Native Landscape
Munich Cloud-Native LandscapeVMware Tanzu
 
How We Fixed Our MongoDB Problems
How We Fixed Our MongoDB Problems How We Fixed Our MongoDB Problems
How We Fixed Our MongoDB Problems MongoDB
 
Cloud-Native Roadshow - Landscape - London
Cloud-Native Roadshow - Landscape - LondonCloud-Native Roadshow - Landscape - London
Cloud-Native Roadshow - Landscape - LondonVMware Tanzu
 
Landscape Cloud-Native Roadshow Los Angeles
Landscape Cloud-Native Roadshow Los AngelesLandscape Cloud-Native Roadshow Los Angeles
Landscape Cloud-Native Roadshow Los AngelesVMware Tanzu
 
Cloud-Native Landscape (Chicago)
Cloud-Native Landscape (Chicago)Cloud-Native Landscape (Chicago)
Cloud-Native Landscape (Chicago)VMware Tanzu
 
Cloud-Native Workshop NYC - The Cloud-Native Landscape
Cloud-Native Workshop NYC - The Cloud-Native LandscapeCloud-Native Workshop NYC - The Cloud-Native Landscape
Cloud-Native Workshop NYC - The Cloud-Native LandscapeVMware Tanzu
 
Cloud-Native Landscape
Cloud-Native LandscapeCloud-Native Landscape
Cloud-Native LandscapeVMware Tanzu
 
Cloud-Native Roadshow - Landscape - Dallas
Cloud-Native Roadshow - Landscape - DallasCloud-Native Roadshow - Landscape - Dallas
Cloud-Native Roadshow - Landscape - DallasVMware Tanzu
 
Cloud-Native Roadshow - Landscape - Atlanta
Cloud-Native Roadshow - Landscape - AtlantaCloud-Native Roadshow - Landscape - Atlanta
Cloud-Native Roadshow - Landscape - AtlantaVMware Tanzu
 
Cloud-Native Roadshow - Landscape - Detroit
Cloud-Native Roadshow - Landscape - DetroitCloud-Native Roadshow - Landscape - Detroit
Cloud-Native Roadshow - Landscape - DetroitVMware Tanzu
 
Cloud-Native Roadshow – Landscape – Amsterdam
Cloud-Native Roadshow – Landscape – AmsterdamCloud-Native Roadshow – Landscape – Amsterdam
Cloud-Native Roadshow – Landscape – AmsterdamVMware Tanzu
 
Cloud-Native Roadshow Boston
Cloud-Native Roadshow BostonCloud-Native Roadshow Boston
Cloud-Native Roadshow BostonVMware Tanzu
 
Cloud-Native Roadshow - Landscape - DC
Cloud-Native Roadshow - Landscape - DCCloud-Native Roadshow - Landscape - DC
Cloud-Native Roadshow - Landscape - DCVMware Tanzu
 
Cloud-Native Roadshow - Landscape - Paris
Cloud-Native Roadshow - Landscape - ParisCloud-Native Roadshow - Landscape - Paris
Cloud-Native Roadshow - Landscape - ParisVMware Tanzu
 
Thoughts on Component Resuse
Thoughts on Component ResuseThoughts on Component Resuse
Thoughts on Component ResuseJustin Edelson
 
Cloud-Native Roadshow - Landscape - Denver
Cloud-Native Roadshow - Landscape - DenverCloud-Native Roadshow - Landscape - Denver
Cloud-Native Roadshow - Landscape - DenverVMware Tanzu
 

Semelhante a Android Clean Architecture for Dummies (20)

Stuttgart Cloud-Native Landscape
Stuttgart Cloud-Native LandscapeStuttgart Cloud-Native Landscape
Stuttgart Cloud-Native Landscape
 
Cloud-Native Roadshow - Landscape - San Francisco
Cloud-Native Roadshow - Landscape - San FranciscoCloud-Native Roadshow - Landscape - San Francisco
Cloud-Native Roadshow - Landscape - San Francisco
 
Cloud-Native Roadshow - Landscape - Toronto
Cloud-Native Roadshow - Landscape - TorontoCloud-Native Roadshow - Landscape - Toronto
Cloud-Native Roadshow - Landscape - Toronto
 
Cloud-Native Roadshow - Landscape - St. Louis
Cloud-Native Roadshow - Landscape - St. LouisCloud-Native Roadshow - Landscape - St. Louis
Cloud-Native Roadshow - Landscape - St. Louis
 
Munich Cloud-Native Landscape
Munich Cloud-Native LandscapeMunich Cloud-Native Landscape
Munich Cloud-Native Landscape
 
How We Fixed Our MongoDB Problems
How We Fixed Our MongoDB Problems How We Fixed Our MongoDB Problems
How We Fixed Our MongoDB Problems
 
Cloud-Native Roadshow - Landscape - London
Cloud-Native Roadshow - Landscape - LondonCloud-Native Roadshow - Landscape - London
Cloud-Native Roadshow - Landscape - London
 
Landscape Cloud-Native Roadshow Los Angeles
Landscape Cloud-Native Roadshow Los AngelesLandscape Cloud-Native Roadshow Los Angeles
Landscape Cloud-Native Roadshow Los Angeles
 
Cloud-Native Landscape (Chicago)
Cloud-Native Landscape (Chicago)Cloud-Native Landscape (Chicago)
Cloud-Native Landscape (Chicago)
 
Cloud-Native Workshop NYC - The Cloud-Native Landscape
Cloud-Native Workshop NYC - The Cloud-Native LandscapeCloud-Native Workshop NYC - The Cloud-Native Landscape
Cloud-Native Workshop NYC - The Cloud-Native Landscape
 
Cloud-Native Landscape
Cloud-Native LandscapeCloud-Native Landscape
Cloud-Native Landscape
 
Cloud-Native Roadshow - Landscape - Dallas
Cloud-Native Roadshow - Landscape - DallasCloud-Native Roadshow - Landscape - Dallas
Cloud-Native Roadshow - Landscape - Dallas
 
Cloud-Native Roadshow - Landscape - Atlanta
Cloud-Native Roadshow - Landscape - AtlantaCloud-Native Roadshow - Landscape - Atlanta
Cloud-Native Roadshow - Landscape - Atlanta
 
Cloud-Native Roadshow - Landscape - Detroit
Cloud-Native Roadshow - Landscape - DetroitCloud-Native Roadshow - Landscape - Detroit
Cloud-Native Roadshow - Landscape - Detroit
 
Cloud-Native Roadshow – Landscape – Amsterdam
Cloud-Native Roadshow – Landscape – AmsterdamCloud-Native Roadshow – Landscape – Amsterdam
Cloud-Native Roadshow – Landscape – Amsterdam
 
Cloud-Native Roadshow Boston
Cloud-Native Roadshow BostonCloud-Native Roadshow Boston
Cloud-Native Roadshow Boston
 
Cloud-Native Roadshow - Landscape - DC
Cloud-Native Roadshow - Landscape - DCCloud-Native Roadshow - Landscape - DC
Cloud-Native Roadshow - Landscape - DC
 
Cloud-Native Roadshow - Landscape - Paris
Cloud-Native Roadshow - Landscape - ParisCloud-Native Roadshow - Landscape - Paris
Cloud-Native Roadshow - Landscape - Paris
 
Thoughts on Component Resuse
Thoughts on Component ResuseThoughts on Component Resuse
Thoughts on Component Resuse
 
Cloud-Native Roadshow - Landscape - Denver
Cloud-Native Roadshow - Landscape - DenverCloud-Native Roadshow - Landscape - Denver
Cloud-Native Roadshow - Landscape - Denver
 

Mais de Kengo Suzuki

Androidのセキュア開発について考えてみた(明日、敗訴しないためのセキュアコーディング.ver2)
Androidのセキュア開発について考えてみた(明日、敗訴しないためのセキュアコーディング.ver2)Androidのセキュア開発について考えてみた(明日、敗訴しないためのセキュアコーディング.ver2)
Androidのセキュア開発について考えてみた(明日、敗訴しないためのセキュアコーディング.ver2)Kengo Suzuki
 
第二回Android training4desinger 2
第二回Android training4desinger 2第二回Android training4desinger 2
第二回Android training4desinger 2Kengo Suzuki
 
第一回Android training4desinger
第一回Android training4desinger第一回Android training4desinger
第一回Android training4desingerKengo Suzuki
 
Android Pen Test - Recon -
Android Pen Test - Recon -Android Pen Test - Recon -
Android Pen Test - Recon -Kengo Suzuki
 
iOSアプリエンジニアの最近
iOSアプリエンジニアの最近iOSアプリエンジニアの最近
iOSアプリエンジニアの最近Kengo Suzuki
 
俺が! 俺たちが! Androidチームだ!
俺が! 俺たちが! Androidチームだ!俺が! 俺たちが! Androidチームだ!
俺が! 俺たちが! Androidチームだ!Kengo Suzuki
 

Mais de Kengo Suzuki (6)

Androidのセキュア開発について考えてみた(明日、敗訴しないためのセキュアコーディング.ver2)
Androidのセキュア開発について考えてみた(明日、敗訴しないためのセキュアコーディング.ver2)Androidのセキュア開発について考えてみた(明日、敗訴しないためのセキュアコーディング.ver2)
Androidのセキュア開発について考えてみた(明日、敗訴しないためのセキュアコーディング.ver2)
 
第二回Android training4desinger 2
第二回Android training4desinger 2第二回Android training4desinger 2
第二回Android training4desinger 2
 
第一回Android training4desinger
第一回Android training4desinger第一回Android training4desinger
第一回Android training4desinger
 
Android Pen Test - Recon -
Android Pen Test - Recon -Android Pen Test - Recon -
Android Pen Test - Recon -
 
iOSアプリエンジニアの最近
iOSアプリエンジニアの最近iOSアプリエンジニアの最近
iOSアプリエンジニアの最近
 
俺が! 俺たちが! Androidチームだ!
俺が! 俺たちが! Androidチームだ!俺が! 俺たちが! Androidチームだ!
俺が! 俺たちが! Androidチームだ!
 

Último

Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxk795866
 
Solving The Right Triangles PowerPoint 2.ppt
Solving The Right Triangles PowerPoint 2.pptSolving The Right Triangles PowerPoint 2.ppt
Solving The Right Triangles PowerPoint 2.pptJasonTagapanGulla
 
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)Dr SOUNDIRARAJ N
 
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfCCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfAsst.prof M.Gokilavani
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girlsssuser7cb4ff
 
8251 universal synchronous asynchronous receiver transmitter
8251 universal synchronous asynchronous receiver transmitter8251 universal synchronous asynchronous receiver transmitter
8251 universal synchronous asynchronous receiver transmitterShivangiSharma879191
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...asadnawaz62
 
Introduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHIntroduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHC Sai Kiran
 
Arduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptArduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptSAURABHKUMAR892774
 
Class 1 | NFPA 72 | Overview Fire Alarm System
Class 1 | NFPA 72 | Overview Fire Alarm SystemClass 1 | NFPA 72 | Overview Fire Alarm System
Class 1 | NFPA 72 | Overview Fire Alarm Systemirfanmechengr
 
Vishratwadi & Ghorpadi Bridge Tender documents
Vishratwadi & Ghorpadi Bridge Tender documentsVishratwadi & Ghorpadi Bridge Tender documents
Vishratwadi & Ghorpadi Bridge Tender documentsSachinPawar510423
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...VICTOR MAESTRE RAMIREZ
 
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEINFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEroselinkalist12
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsyncWhy does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsyncssuser2ae721
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx959SahilShah
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfAsst.prof M.Gokilavani
 

Último (20)

Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptx
 
Solving The Right Triangles PowerPoint 2.ppt
Solving The Right Triangles PowerPoint 2.pptSolving The Right Triangles PowerPoint 2.ppt
Solving The Right Triangles PowerPoint 2.ppt
 
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
 
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfCCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girls
 
8251 universal synchronous asynchronous receiver transmitter
8251 universal synchronous asynchronous receiver transmitter8251 universal synchronous asynchronous receiver transmitter
8251 universal synchronous asynchronous receiver transmitter
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...
 
Introduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHIntroduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECH
 
Arduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptArduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.ppt
 
Class 1 | NFPA 72 | Overview Fire Alarm System
Class 1 | NFPA 72 | Overview Fire Alarm SystemClass 1 | NFPA 72 | Overview Fire Alarm System
Class 1 | NFPA 72 | Overview Fire Alarm System
 
Vishratwadi & Ghorpadi Bridge Tender documents
Vishratwadi & Ghorpadi Bridge Tender documentsVishratwadi & Ghorpadi Bridge Tender documents
Vishratwadi & Ghorpadi Bridge Tender documents
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...
 
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEINFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
 
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsyncWhy does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
 
Design and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdfDesign and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdf
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
 

Android Clean Architecture for Dummies

  • 3. Self Introduction name: Kengo Suzuki twitter: @kengoScal 3 2011∼2014:Security Analyst 2014年11月: Joined MoneyForward 2014年11月∼2015年01月: iOS 2015年02月∼08月:Android 2015年09月∼10月 : Security Architect 2015年11月 : Security Architect/Management + Android
  • 4. 4 In Charge of New Android App!
  • 6. What is it & Why using it? 6
  • 7. What is it & Why using it? 7 Not Today.
  • 8. Plenty of Good Entries(with source codes) 8 • English • Architecting Android…The Clean Way? • Clean Android Architecture • MVP for Android: how to organize presentation layer • Japanese • AndroidオールスターズでClean Architectureについて発 表してきた • これからの設計の話をしよう • AndroidではMVCよりMVPの方がいいかもしれない
  • 9. Plenty of Good Entries(with source codes) 9 • English • Architecting Android…The Clean Way? • Clean Android Architecture • MVP for Android: how to organize presentation layer • Japanese • AndroidオールスターズでClean Architectureについ て発表してきた • これからの設計の話をしよう • AndroidではMVCよりMVPの方がいいかもしれない Big Picture Source Code Roles Big Picture Roles Presenter
  • 10. Right off the Bat? 10 訳: すぐに/直ちに
  • 11. Need Endurance! 11 • Codes aren t self explanatory • Lack of experience in using core liibraries could be pain • Don t know what goes where.
  • 12. 12
  • 13. Architecure is About Intent, not Frameworks 13 by Robert Cecil Martin
  • 14. With the Hope, no one gives up architecting 14
  • 15. How to use it (Tutorial) 15
  • 16. Primitive App 16 • Single Activity • Single List View • Horizontally aligned texts • Fab • click and fetch data • Fetch MusicList(data) • by Retrofit • freemusicarchive.org • DI and EventHub • Under Construction
  • 17. Click And Fetch Data Tutorial 17
  • 18. The Goal 18 • Click Fab • Run Retrofit to fetch data • Not considering data response
  • 19. 19 What We Will Implement • reference • Architecting Android…The Clean Way?: • これからの設計の話をしよう
  • 20. Thing You Need To Implement 20 • MainActivity • MusicListPresenter • MusicListUseCase • MusicListUseCaseImpl • MusicListRepository • MusicListRepositoryImpl • MusicListEntity
  • 21. Data Domain Presentation Thing You Need To Implement 21 • MainActivity • MusicListAdapter • MusicListPresenter • MusicListUseCase • MusicListUseCaseImpl • MusicListRepository • MusicListRepositoryImpl • MusicListEntity
  • 22. Presentation - UserAction 22 • Main Activity & MusicListAdapter • Render List View attaching adapter • Initialize followings • repository, usecase, presenter • Pass FAB clicked event along with Main Thread Info to Presenter • MusicListPresenter • Receive FAB clicked event from View • Execute MusicListUseCase(Imp) Job • Pass thread info to MusicListUseCas(Imp)
  • 23. 23 What We Just Implemented • reference • Architecting Android…The Clean Way?: • これからの設計の話をしよう
  • 24. Domain - User Action to Data Interface 24 • MusicUseCase • Provide interface between Domain Layer & Presentation Layer • MusicUseCaseImp • Ask MusicListRepository(Imp) for API(External Resource) • MusicListRepository • Provide interface between Domain Layer & Data Layer
  • 25. 25 What We Just Implemented • reference • Architecting Android…The Clean Way?: • これからの設計の話をしよう
  • 26. Data - Data Interface to DataSource 26 • MusicListRepositoryImp • To Fetch external Data • Declare and Execute Retrofit Http Client • GET http://freemusicarchive.org/api? key={key} • MusicListEntity • Parse Response and map to domain/model • gson will handle it.
  • 27. 27 What We Just Implemented • reference • Architecting Android…The Clean Way?: • これからの設計の話をしよう
  • 28. That s it for Fetching Data 28 Now we want to Reflect Data
  • 29. Reflect Data to View Tutorial 29
  • 30. The Goal 30 • Pass back data just fetched • Update View
  • 31. 31 What We Will Implement • reference • Architecting Android…The Clean Way?: • これからの設計の話をしよう
  • 32. Thing You Need To Implement 32 • MusicListRepository#MusicListFetchCallback • MusicListUseCaseImpl • MusicListUseCase#MusicListUseCaseCallback • MusicListPresenter • MusicListPresenter#MusicListViewCallback • MainActivity
  • 33. Presentation Domain Data Thing You Need To Implement 33 • MusicListRepository#MusicListFetchCallback • MusicListUseCaseImpl • MusicListUseCase#MusicListUseCaseCallback • MusicListPresenter • MusicListPresenter#MusicListViewCallback • MainActivity
  • 34. Domain - Passing Data to User Interface 34 • MusicListRepository#MusicListFetchCallback • MusicListUseCaseImpl • Implement MusicListFetchCallback • So that Main Threat can receive runnable with command with fetched data • MusicListUseCase#MusicListUseCaseCallback • MusicListPresenter • MusicListPresenter#MusicListViewCallback • MainActivity
  • 35. 35 What We Just Implemented • reference • Architecting Android…The Clean Way?: • これからの設計の話をしよう
  • 36. Presentation - Updating View 36 • MusicListUseCase#MusicListUseCaseCallback • MusicListPresenter#MusicListViewCallback • MusicListPresenter • Implement MusicListUseCaseCallback • Execute methods in MusicListViewCallback • MainActivity • Implement MusicListViewCallback • So that User Case can pass fetched data • So that Activity can update adapter data
  • 37. 37 What We Just Implemented • reference • Architecting Android…The Clean Way?: • これからの設計の話をしよう
  • 39. Lots of Room for Improvement 39 • Callback Repetition is quite Ugly • Many Reinvent Wheel • Not using Dagger, RxJava • Not a big fun of passing thread around • Tutorial itself wasn t thoroughly covered
  • 43. References 43 • English • Architecting Android…The Clean Way?: http://fernandocejas.com/ 2014/09/03/architecting-android-the-clean-way/ • Clean Android Architecture: https://speakerdeck.com/richk/clean- android-architecture • MVP for Android: how to organize presentation layer: http:// antonioleiva.com/mvp-android/ • Japanese • AndroidオールスターズでClean Architectureについて発表してきた: http:// tomoima525.hatenablog.com/entry/2015/08/13/190731 • これからの設計の話をしよう: http://www.slideshare.net/ shinnosukekugimiya/ss-50705888 • AndroidではMVCよりMVPの方がいいかもしれない: http:// konifar.hatenablog.com/entry/2015/04/17/010606