android10 / android10/Android-CleanArchitecture
Where Content Provider and Service would fit?
- Dominant language
- Java
- Stars
- 15.5k
- Forks
- 3.3k
- PR merge metrics
- No merged PRs in 30d
Description
This is not an issue, just an architectural question...
Let's say that our application has a SQLite database, a Content Provider that exposes this data and an IntentService that is responsible for syncing data by calling the REST service and updating the database.
Where these two components should be placed?
I think The ContentProvider would easily be placed in the data module.
An additional Repository implementation in the data module would query the content provider and transform the cursor data into entity objects in order to be consumed by the Use Cases. For the UseCase there's no difference. It will still talk to the interface and it will get back the data it wants. Of course, the proper concrete implementation would be injected via dagger.
The Service could also be placed in the data module.
A new interface could be introduced in the domain, i.e. SyncRepository which will be used by the Use Case. The actual implementation of it (in the data module) will start the service with an Intent.
What do you think?
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.