Q: Does the DaggerModule for UseCase still necessary?
I saw your commit days ago which refactor UseCase to be base on Generic type. As a result, now we can inject repository (and others) to UseCase eg. GetUserDetails directly without defined in (Dagger) UserModule.
So does the UserModule still necessary? Can we get rid of it? because it is now just almost a blank module class which need to be implement nothing.
In my opinion this is not right. I have tried the way they provided the dependency.I could find some problem with it.
-
As we have followed modular approach with app , domain and data and we are providing the dependency through app module we may get confused with what a particular class in a particular domain needs as its dependency. All the dependencies should be provided from the one module residing in the app module.
-
If in future your dependencies change for a class you don't need to find where and how the dependencies are being provided ,just go the specific module class which provides the dependencies and change the constructor or provide any other dependency.
-
Writing unit test cases is easy when u provide dependency through constructor in module class
NOTE : This is just what i have observed i don't know if it is the correct way.