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
58
Reuso de código com Kotlin Multiplataforma
felipehjcosta
0
110
Code reuse with Kotlin Multiplatform
felipehjcosta
1
200
Why Reactive Programming?
felipehjcosta
4
6.2k
Introdução ao Android Studio
felipehjcosta
0
47
Other Decks in Programming
See All in Programming
Kubernetes for Data Engineers: Building Scalable, Reliable Data Pipelines
sucitw
1
200
Hotwire or React? ~Reactの録画機能をHotwireに置き換えて得られた知見~ / hotwire_or_react
harunatsujita
9
4.1k
弊社の「意識チョット低いアーキテクチャ」10選
texmeijin
5
23k
Dev ContainersとGitHub Codespacesの素敵な関係
ymd65536
1
130
Importmapを使ったJavaScriptの 読み込みとブラウザアドオンの影響
swamp09
4
1.2k
/←このスケジュール表に立ち向かう フロントエンド開発戦略 / A front-end development strategy to tackle a single-slash schedule.
nrslib
1
590
GitHub Actionsのキャッシュと手を挙げることの大切さとそれに必要なこと
satoshi256kbyte
5
390
Golang と Erlang
taiyow
8
1.9k
シールドクラスをはじめよう / Getting Started with Sealed Classes
mackey0225
3
400
リリース8年目のサービスの1800個のERBファイルをViewComponentに移行した方法とその結果
katty0324
5
3.6k
qmuntal/stateless のススメ
sgash708
0
120
Snowflake x dbtで作るセキュアでアジャイルなデータ基盤
tsoshiro
2
430
Featured
See All Featured
[RailsConf 2023] Rails as a piece of cake
palkan
51
4.9k
Statistics for Hackers
jakevdp
796
220k
Fantastic passwords and where to find them - at NoRuKo
philnash
50
2.8k
Teambox: Starting and Learning
jrom
132
8.7k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
364
22k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
664
120k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.1k
Facilitating Awesome Meetings
lara
49
6k
Fireside Chat
paigeccino
32
3k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
246
1.3M
Fashionably flexible responsive web design (full day workshop)
malarkey
404
65k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5k
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