Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Android Clean Architecture
Search
Felipe Costa
October 28, 2015
Programming
2
160
Android Clean Architecture
Introdução ao Clean Architecture aplicado ao Android.
Felipe Costa
October 28, 2015
Tweet
Share
More Decks by Felipe Costa
See All by Felipe Costa
Expecting fun with Kotlin Multiplatform Mobile
felipehjcosta
0
200
Reuso de código com Kotlin Multiplataforma @ KotlinConf Global 2019 - Curitiba
felipehjcosta
0
290
Code reuse with Kotlin Multiplatform @ KotlinConf Global 2019 - Curitiba
felipehjcosta
1
53
Mobile Continuous Delivery na OLX
felipehjcosta
0
23
Mobile Continuous Delivery at OLX
felipehjcosta
1
59
Reuso de código com Kotlin Multiplataforma
felipehjcosta
0
110
Code reuse with Kotlin Multiplatform
felipehjcosta
1
210
Why Reactive Programming?
felipehjcosta
4
6.2k
Introdução ao Android Studio
felipehjcosta
0
50
Other Decks in Programming
See All in Programming
Enabling DevOps and Team Topologies Through Architecture: Architecting for Fast Flow
cer
PRO
0
340
Quine, Polyglot, 良いコード
qnighy
4
650
Ethereum_.pdf
nekomatu
0
470
Functional Event Sourcing using Sekiban
tomohisa
0
100
cmp.Or に感動した
otakakot
3
210
Realtime API 入門
riofujimon
0
150
AI時代におけるSRE、 あるいはエンジニアの生存戦略
pyama86
6
1.2k
watsonx.ai Dojo #4 生成AIを使ったアプリ開発、応用編
oniak3ibm
PRO
1
150
聞き手から登壇者へ: RubyKaigi2024 LTでの初挑戦が 教えてくれた、可能性の星
mikik0
1
130
What’s New in Compose Multiplatform - A Live Tour (droidcon London 2024)
zsmb
1
480
カンファレンスの「アレ」Webでなんとかしませんか? / Conference “thing” Why don't you do something about it on the Web?
dero1to
1
110
型付き API リクエストを実現するいくつかの手法とその選択 / Typed API Request
euxn23
8
2.2k
Featured
See All Featured
No one is an island. Learnings from fostering a developers community.
thoeni
19
3k
Become a Pro
speakerdeck
PRO
25
5k
Six Lessons from altMBA
skipperchong
27
3.5k
KATA
mclloyd
29
14k
Raft: Consensus for Rubyists
vanstee
136
6.6k
Rails Girls Zürich Keynote
gr2m
94
13k
StorybookのUI Testing Handbookを読んだ
zakiyama
27
5.3k
How GitHub (no longer) Works
holman
310
140k
Reflections from 52 weeks, 52 projects
jeffersonlam
346
20k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
665
120k
Building Adaptive Systems
keathley
38
2.3k
The Language of Interfaces
destraynor
154
24k
Transcript
CLEAN ARCHITECTURE NO ANDROID FELIPE COSTA
ANDROID
ANDROID MVC ▸ Trygve Reenskaug (1979) ▸ Smalltalk ▸ GUI
▸ UI X lógica ▸ Componentes Principais: Model, View, Controller MODEL CONTROLLER VIEW UPDATES MANIPULATES USER SEES USES
ANDROID MODEL ▸ Dados da Aplicação ▸ Regras de negócio
▸ Lógica ▸ Funções
ANDROID VIEW ▸ UI ▸ Exibição de dados do modelo
ANDROID CONTROLLER ▸ Intermediação entre View e Model ▸ Envio
de comandos para o Model ▸ Envio de comandos para a View
ANDROID PROBLEMAS DO MVC ▸ Mistura entre lógica de domínio/negócio/aplicação
▸ Fat Controller ▸ Fat model, skinny controller ▸ God objects ▸ Difícil de testar (Unit Test)
ANDROID ALTERNATIVAS AO MVC ▸ MVP ▸ MVVM
CLEAN ARCHITECTURE
ARCHITECTURE IS ABOUT INTENT, NOT FRAMEWORKS Uncle Bob CLEAN ARCHITECTURE
None
CLEAN ARCHITECTURE ENTITIES ▸ Objetos de negócio
CLEAN ARCHITECTURE USE CASES ▸ Regras de negócio ▸ Controle
do fluxo de dados de e para as entities ▸ Interactors
CLEAN ARCHITECTURE INTERFACE ADAPTERS ▸ Conversão dos dados para um
formato mais conviniente para os use Cases e entities ▸ Presenters e Controllers
CLEAN ARCHITECTURE FRAMEWORKS AND DRIVERS ▸ UI ▸ Frameworks ▸
Database ▸ Tools ▸ etc
CLEAN ARCHITECTURE CROSSING BOUNDARIES PRESENTER USE CASE OUTPUT PORT USE
CASE INPUT PORT USE CASE INTERACTION CONTROLLER CONTROLE DE FLUXO
CLEAN ARCHITECTURE DEPENDENCY RULE ▸ A dependência de código somente
pode apontar para dentro ▸ Os círculos internos não podem conhecer nada sobre os círculos externos ▸ Não está restrito a quantidade de círculos
CLEAN ARCHITECTURE CONSEQUÊNCIAS ▸ Independência de Framework ▸ Testável (Unit
Test) ▸ Independência de UI ▸ Independência de DB ▸ Independência de agentes externos
DO NOT DEPEND ON THINGS THAT CHANGE OR ARE LIKELY
TO CHANGE Uncle Bob CLEAN ARCHITECTURE
ANDROID ARCHITECTURE
ANDROID ARCHITECTURE DOMAIN LAYER JAVA BUSINESS RULES DATA LAYER ANDROID
LIBRARY DATA PRESENTATION LAYER JAVA MVC MVP MVVM APPLICATION LAYER ANDROID APP UI
ANDROID ARCHITECTURE CONSEQUÊNCIAS ▸ Fácil de Manter ▸ Fácil de
testar (Unit Test) ▸ Muito coesa ▸ Desacoplada ▸ S.O.L.I.D
ANDROID ARCHITECTURE LINKS ▸ https://blog.8thlight.com/uncle-bob/2012/08/13/the-clean- architecture.html ▸ https://vimeo.com/43612849 ▸ http://fernandocejas.com/2014/09/03/architecting-
android-the-clean-way/ ▸ https://github.com/android10/Android-CleanArchitecture ▸ https://github.com/mcharmas/shoppinglist-clean- architecture-example
QA
OBRIGADO FELIPE COSTA E-MAIL:
[email protected]
TWITTER: @FELIPEHJCOSTA