android10 / Android-CleanArchitecture-Kotlin

This is a movies sample app in Kotlin, which is part of a serie of blog posts I have written about architecting android application using different approaches.
https://fernandocejas.com/2018/05/07/architecting-android-reloaded/
4.68k stars 928 forks source link

Reactive Programming #78

Open CristianMG opened 5 years ago

CristianMG commented 5 years ago

Any idea that how to use this architecture to be able to observe changes in database or firebase etc.

Could be modified or create a new use case class

Greetings

Zhuinden commented 5 years ago

The usecase classes only do the equivalent of Single<Result<T>> and therefore you'd need to ditch the usecase and rather observe something that lets you observe it.

CristianMG commented 5 years ago

The repositories can expose directly their Reactive functions to ViewModel.

It would be correct to use the functions that can be reactive as functions of RX-Java and the other functions as Coroutines.

Or is better to renounce to Rx-Java and use only Coroutines as Reactive Streams for instance Channels of Coroutines.

The other way isn´t using the coroutines of Kotlin and uses only the Rx-Java functions.

It would better use only one framework?

I think would better unify the data access for don´t break the pattern depending on the type of functions a people need.

Sorry but the English not is my native language

Thanks for your response

ghost commented 2 years ago

Why not to create separate use-case abstraction which will satisfy the reactive execution unit! For instance FlowUseCase<in T, out T>