Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Android functional clean architecture

Android functional clean architecture

Clean architecture separates your project into well defined layers: data, domain and presentation.
It enables easy testability and keeps your design adaptable to change.
Nowadays developing in Kotlin using functional types we can make it even more concise and boilerplate-less while clearly demonstrating our intent.

lukaszkalnik

January 16, 2020
Tweet

Other Decks in Technology

Transcript

  1. Reasons • Separation of concerns: data - business logic -

    presentation • High cohesion & loose coupling • Easy exchange of data sources and view dependency in presentation layer • This leads to easy testability • Code reuse
  2. Clean architecture Presentation layer Android UI Framework (Activity/Fragment) Domain layer

    Data layer Android data sources - REST API, Bluetooth, Shared Prefs Library API layer Library consumer (Android app data layer) Android application Android library
  3. Gateway SDK example • Gets/sends data to a gateway •

    Converts the data in use cases to domain model • Presentation layer = library API layer