I am trying to implement clean architecture (https://8thlight.com/blog/uncle-bob/2012/08/13/the-clean-architecture.html) on an Android app. As an example, let's say that all the app does is monitors a user's CPU temp and displays a hourly and daily average. Data is stored on the device and periodically downsampled. The downsampled data is uploaded to a backend.
All of the clean architecture examples I have seen is for the same types of apps - eg. Apps that have a UI to CRUD data, usually something in the line of: The UI sends click events to the presenter, presenter executes a use case interactor, interactor retrieves data from a repository, the presenter sends the data to the UI.
My app has practically zero user interaction:
- A background service measures the CPU temp and writes it to the
database. - A separate background process downsamples the data and writes it to the database.
- Yet another background process syncs the downsampled data with the backend
- The background services are scheduled to run on a fixed interval by a job scheduler
- All the user sees is his current CPU, the averages and maybe notifications that syncing has completed successfully.
How would I structure this in terms of clean architecture? More specifically:
- What are my use cases?
- Are the services in the same layer as the view would have been?
- Do I need a presenter at all? (Maybe for displaying status notifications from the service, I can't see any other reason?)
- Do I need separate repositories for my high resolution and lower resolution data?
I realise this is a lot of questions, but I would appreciate any input or pointers in the right direction.