Example App Architecture
April 18, 2017 ยท View on GitHub
As Pilot concerns itself with the UI & Presenter/Controller layer only it needs to be used as part of a wider app architecture. There is flexibility in this, but an example Clean-style architecture is shown below.
The below architecture embodies Clean Architecture principles, and is similar to the Viper iOS architecture.
Overview

Layers
View Layer
- Plain-Old-Android-Views! These forward input events to and render state from their corresponding Presenter
PilotFrames. - Interacts with Presenter layer by forwarding input-events, and rendering the Presenters
Stateobject when changed.
Presenter Layer
- The PilotStack, which holds mostly Presenter
PilotFrameswith some data only frames. - Presentation Model styles Presenters
- This layer interacts with the Use-Case layer mostly via asynchronous callbacks. This is preferred over
Observablesat this stage as the returned data may be complicated (i.e could be success with some data, or multiple errors with differnt meta data). - Use-case dependencies should be DI'd into the Presenter layer, as opposed to constructor passed, as the
PilotFrameshave fixed constructors.
Use-Case (Interactor) Layer
- Embodies Use-Cases i.e.
Login,GetDataXetc. - Interacts with model layer via
Observablesfor easy composition inside the Use-Case layer. - Model dependencies should be passed via constructor or DI'd to this layer.
Model Layer
- Represents all in-memory-data and all data-sources (i.e. remote API, local DB etc)