Android-CleanArchitecture-Kotlin
Android-CleanArchitecture-Kotlin copied to clipboard
How to create database in this architecture?
Why is this closed? Any idea that you can share? Initially, i was thinking to use Room but it is not included in this project
Theoretically the UseCase should save to DB, while the DB exposes either LiveData<List<T>> or Flowable<List<T>> to observe changes.
Data from network shouldn't be given back to UI directly, nor to the ViewModel's LiveData really (assuming there is local db).
ok is there a fork of this project that has Room incorporated?
I'm finding a way to use realm database. It is provided as a Network inside Repository.
I'm finding a way to use realm database. It is provided as a Network inside Repository.
room would be a great example for this awesome clean arch
I have an example using as base this project in my own repository.
https://github.com/CristianMG/KCleanArchitectureExample
But, I have a question, in this example the repository seems be using directly of use cases. I create my own repository with different annotations in dagger one of them cloud and other disk, but the disk repository has unused functions.
This breaks one of solid's principle "Interface segregation principle". here you can view the example https://gist.github.com/CristianMG/2c228e40bcf2166ce9daee6e70d5dc3f
As you can see there are functions in one of implementation that throw exception, I'm not pleased with this type solution.
I would like to know if any knows better solution without break the solid principle.
Thanks
@android10 @Zhuinden