forgetting android
DESCRIPTION
This talk is about use clean architecture on android development.TRANSCRIPT
Forgetting Android
Jorge J. Barroso!Tech Lead Android [email protected]!@flipper83
Any fool can write code that a computer can understand. Good programmers write code that humans can understand.!Martin Fowler
1 Solid
Single responsibility principle
Open/closed principle
Liskov substitution principle
Interface segregation principle
Dependency inversion principle
Clean Architecture2
A good architecture allows you to defer framework decisions. A good architecture allows frameworks to act as plugins to the app.!Robert Martin
“The database is a detail, a hardware detail. We would not use one at all if all our data could fit in memory for ever”
UI
External!Interfaces
Db
Push
Network
Storag
e
Inte
rface
s
Inte
rface
s
Business Model
Interactors
Interactors
UI!Layer
UI!Layer
UI!Data Model
Data Mapper
Bou
ndar
y Interactor
Bussines!Data Model
Data!Storage
Test!Storage
Data Mapper
Data Mapper
Storage!Data Model
Test!Data Model
FeedViewModel
FeedBoundary
FeedListFragment
FeedProvider
GetFeed GetFeedImp
List<Hipster>
User!DataSource!
Net
Use
rDat
aSou
rce
Like
Dat
aSou
rce
Like!DataSource!
Parse
API
UserApi
API
Retrofit!api
Parse!api
Good Layer Responsabilites
Easy to test and mock
Easy to add or modify code
Easy to hide implementations
Easy to find smells
Async code
Duplicate data model
Change your mind
Not silver bullets