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
300
Code reuse with Kotlin Multiplatform @ KotlinConf Global 2019 - Curitiba
felipehjcosta
1
54
Mobile Continuous Delivery na OLX
felipehjcosta
0
25
Mobile Continuous Delivery at OLX
felipehjcosta
1
63
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
52
Other Decks in Programming
See All in Programming
いりゃあせ、PHPカンファレンス名古屋2025 / Welcome to PHP Conference Nagoya 2025
ttskch
1
180
ドメインイベント増えすぎ問題
h0r15h0
2
570
Внедряем бюджетирование, или Как сделать хорошо?
lamodatech
0
940
Jaspr Dart Web Framework 박제창 @Devfest 2024
itsmedreamwalker
0
150
watsonx.ai Dojo #6 継続的なAIアプリ開発と展開
oniak3ibm
PRO
0
170
Androidアプリのモジュール分割における:x:commonを考える
okuzawats
1
280
CQRS+ES の力を使って効果を感じる / Feel the effects of using the power of CQRS+ES
seike460
PRO
0
240
rails newと同時に型を書く
aki19035vc
5
710
為你自己學 Python
eddie
0
520
歴史と現在から考えるスケーラブルなソフトウェア開発のプラクティス
i10416
0
300
DevinとCursorから学ぶAIエージェントメモリーの設計とMoatの考え方
itarutomy
0
150
“あなた” の開発を支援する AI エージェント Bedrock Engineer / introducing-bedrock-engineer
gawa
4
240
Featured
See All Featured
Building an army of robots
kneath
302
45k
Into the Great Unknown - MozCon
thekraken
34
1.6k
Building Flexible Design Systems
yeseniaperezcruz
328
38k
Gamification - CAS2011
davidbonilla
80
5.1k
Facilitating Awesome Meetings
lara
51
6.2k
Visualization
eitanlees
146
15k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.4k
Done Done
chrislema
182
16k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
49k
jQuery: Nuts, Bolts and Bling
dougneiner
62
7.6k
Fontdeck: Realign not Redesign
paulrobertlloyd
82
5.3k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
8
1.2k
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