Android-CleanArchitecture-Kotlin
Android-CleanArchitecture-Kotlin copied to clipboard
UseCase dependencies
I thought UseCases shouldn't have any framework dependencies but PlayMovie has a Context in it and a Navigator which contains android specific code. I'm a little bit confused, am I missing something?
Those are implementation details which inherit the abstraction UseCase which is what from my perspective belongs to the domain layer.
Otherwise, I do not see any other way to achieve those actions through UseCases.
Use cases should live in the domain layer and be free of framework code. The domain layer should be free of framework code!
The way round this issue is to create an interface for the Navigator, just like we have interfaces for repositories. The implementation of the Navigator would be in app most likely where it can use the context.