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
170
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
230
Reuso de código com Kotlin Multiplataforma @ KotlinConf Global 2019 - Curitiba
felipehjcosta
0
340
Code reuse with Kotlin Multiplatform @ KotlinConf Global 2019 - Curitiba
felipehjcosta
1
68
Mobile Continuous Delivery na OLX
felipehjcosta
0
30
Mobile Continuous Delivery at OLX
felipehjcosta
1
68
Reuso de código com Kotlin Multiplataforma
felipehjcosta
0
120
Code reuse with Kotlin Multiplatform
felipehjcosta
1
240
Why Reactive Programming?
felipehjcosta
4
6.2k
Introdução ao Android Studio
felipehjcosta
0
61
Other Decks in Programming
See All in Programming
明日から始めるリファクタリング
ryounasso
0
120
Go言語の特性を活かした公式MCP SDKの設計
hond0413
1
200
実践AIチャットボットUI実装入門
syumai
7
2.5k
Cloudflare AgentsとAI SDKでAIエージェントを作ってみた
briete
0
130
GitHub Actions × AWS OIDC連携の仕組みと経緯を理解する
ota1022
0
240
Catch Up: Go Style Guide Update
andpad
0
200
Back to the Future: Let me tell you about the ACP protocol
terhechte
0
130
ソフトウェア設計の実践的な考え方
masuda220
PRO
3
500
いま中途半端なSwift 6対応をするより、Default ActorやApproachable Concurrencyを有効にしてからでいいんじゃない?
yimajo
2
360
あなたの知らない「動画広告」の世界 - iOSDC Japan 2025
ukitaka
0
420
After go func(): Goroutines Through a Beginner’s Eye
97vaibhav
0
240
Domain-centric? Why Hexagonal, Onion, and Clean Architecture Are Answers to the Wrong Question
olivergierke
1
550
Featured
See All Featured
Documentation Writing (for coders)
carmenintech
75
5k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
29
2.6k
Faster Mobile Websites
deanohume
310
31k
Docker and Python
trallard
46
3.6k
Balancing Empowerment & Direction
lara
4
680
The World Runs on Bad Software
bkeepers
PRO
71
11k
Gamification - CAS2011
davidbonilla
81
5.5k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
9
850
GraphQLとの向き合い方2022年版
quramy
49
14k
Embracing the Ebb and Flow
colly
88
4.8k
Designing for Performance
lara
610
69k
Fashionably flexible responsive web design (full day workshop)
malarkey
407
66k
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