Skip to content
Commitwise
Menu

Clean Architecture

Organizing an app in layers where business rules don't depend on UI, frameworks or databases, and dependencies point inward.

Definition

The idea, popularized by Robert C. Martin, is that the core logic of an app should be plain code that can be tested and reused without the UI or the storage technology. On Android it usually appears in a pragmatic form: a UI layer, an optional domain layer with use cases, and a data layer with repositories. Taken too far, it produces pass-through use cases and a mapper for every layer without isolating any real logic.

In practice

CanCancelOrderUseCase is plain Kotlin used by two screens and tested with a fake clock; it knows nothing about Compose or Room.

Related terms

Esc

Type to search the whole site.