Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Clean Architecture
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Andrei Lisun
June 03, 2017
Programming
120
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Clean Architecture
Andrei Lisun
June 03, 2017
Other Decks in Programming
See All in Programming
作れる、でも消せるか?──安全に「枯らして消す」機能削除術 / Drain, Then Delete
chobishiba
2
760
すこし踏み込む CancellationToken
htkym
2
1.7k
カツオ、ご期待ください
suneo3476
0
190
When benchmarks go bad - what I learned from measuring performance wrong
hollycummins
0
220
AIに “答え“を書かせるのを やめてみた
___akari11
0
120
IBM Bob Dojo #1 仕様駆動開発入門
oniak3ibm
PRO
0
390
Railsのためのパスキー実践入門 〜マルチテナントSaaSでの意思決定〜
utakaha
2
650
機械に任せるテスト、人が見るテスト ⽣成AIで引き直した、運⽤保守フェーズの線引き
dske104
0
190
Event is what happens
moro
2
840
コードレビューのボトルネックを"する側"と"される側"の両面から解消する
yub0n
2
1.6k
AWSに止められる覚悟してますか?
morizo_1984
2
540
半永久的に提供し続けられるプライベートクラウドを目指して ― 利用者の認知負荷を抑えるAPI抽象化とハードウェア世代交代の基盤設計
tomokon
0
500
Featured
See All Featured
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
330
Testing 201, or: Great Expectations
jmmastey
46
8.3k
sira's awesome portfolio website redesign presentation
elsirapls
0
460
brightonSEO & MeasureFest 2025 - Winning Strategies for Black Friday CRO & PPC - Christian Goodrich
cargoodrich
3
870
Designing Powerful Visuals for Engaging Learning
tmiket
1
610
Navigating Team Friction
lara
192
16k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.6k
Google's AI Overviews - The New Search
badams
0
1.6k
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
340
The SEO identity crisis: Don't let AI make you average
varn
0
590
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
6.1k
WCS-LA-2024
lcolladotor
0
890
Transcript
Clean Architecture Andrei Lisun
Why? “My apps work without any architecture” • Architecture makes
it easier or harder to think about problems you need to solve. • Architectural decisions stick with your app.
Trends change quickly, but some basic principles are timeless
• UI can be changed easily • DBMS can be
changed easily • No Android framework dependencies = local unit tests Independent of UI, DB, Frameworks
• Elements have singularity of purpose Separation of concerns
• More local unit tests = better • Allows to
cover at least business logic Testable
• Encourages to write code without repetition DRY
Independence SoC Testable DRY
Model-View-Presenter
View Presenter Repository Remote data source Local data source Realm,
SQlite Retrofit UI • Activity, Fragment • Presents data in a way decided by the Presenter • Fully passive • Has reference to Presenter
View Presenter Repository Remote data source Local data source Realm,
SQlite Retrofit UI • Makes queries to the Repository • Updates the View • All business logic here • Has reference to the View and Repository
• Responsible for managing data • Manages in-memory cache •
No business logic here View Presenter Repository Remote data source Local data source Realm, SQlite Retrofit UI
View Presenter Repository Remote data source Local data source Realm,
SQlite Retrofit UI
Independence View Presenter Repository Remote data source Local data source
Realm, SQlite Retrofit UI
Independence SoC Testable DRY View Presenter Repository Remote data source
Local data source Realm, SQlite Retrofit UI
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
Move to Repository? • No business logic in Repository •
Repository is already quite large
Extract Class?
View Presenter Repository Remote data source Local data source
View Presenter Repository Remote data source Local data source
Use Case Use Case View Presenter Repository Remote data source
Local data source ...
Use Case Use Case View Presenter Repository Remote data source
Local data source ... Layers
Use Case Use Case View Presenter Repository Remote data source
Local data source ... Data Layers
Use Case Use Case View Presenter Repository Remote data source
Local data source ... Layers Domain Data
Use Case Use Case View Presenter Repository Remote data source
Local data source ... Layers Domain Presentation Data
Use Case Use Case View Presenter Repository Remote data source
Local data source ... Clean Architecture Domain Presentation Data
Use Case Use Case View Presenter Repository Remote data source
Local data source ... Domain Presentation Independence SoC Testable DRY Data
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
• Testing is easier • Easy to add new features
• Code is more maintainable • Bugs are easier to isolate Pros
• Lots of details • More code to write Cons
Clean Architecture Sample: https://github.com/googlesamples/android-architecture/tree/todo-mvp-clean/ Clean Architecture Sample(separate modules): https://github.com/android10/Android-CleanArchitecture Android
Architecture Telegram group: https://t.me/Android_Architecture