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
210
Why Reactive Programming?
felipehjcosta
4
6.2k
Introdução ao Android Studio
felipehjcosta
0
50
Other Decks in Programming
See All in Programming
ActiveSupport::Notifications supporting instrumentation of Rails apps with OpenTelemetry
ymtdzzz
1
230
ヤプリ新卒SREの オンボーディング
masaki12
0
130
CSC509 Lecture 12
javiergs
PRO
0
160
Better Code Design in PHP
afilina
PRO
0
130
型付き API リクエストを実現するいくつかの手法とその選択 / Typed API Request
euxn23
8
2.2k
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
0
100
Less waste, more joy, and a lot more green: How Quarkus makes Java better
hollycummins
0
100
as(型アサーション)を書く前にできること
marokanatani
10
2.7k
Remix on Hono on Cloudflare Workers
yusukebe
1
290
2024/11/8 関西Kaggler会 2024 #3 / Kaggle Kernel で Gemma 2 × vLLM を動かす。
kohecchi
5
920
OnlineTestConf: Test Automation Friend or Foe
maaretp
0
110
Click-free releases & the making of a CLI app
oheyadam
2
120
Featured
See All Featured
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
226
22k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Embracing the Ebb and Flow
colly
84
4.5k
We Have a Design System, Now What?
morganepeng
50
7.2k
Java REST API Framework Comparison - PWX 2021
mraible
PRO
28
8.2k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
6
410
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
126
18k
VelocityConf: Rendering Performance Case Studies
addyosmani
325
24k
A Philosophy of Restraint
colly
203
16k
[RailsConf 2023] Rails as a piece of cake
palkan
52
4.9k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
25
1.8k
RailsConf 2023
tenderlove
29
900
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