I’m using here Dagger Providers to avoid creating new instances of dependencies after every configuration change.
I wonder how using
Provider<T> affects scoping of
T . In other words,
provider.get() would return a new instance each time if class
T does not have appropriate scoping (i.e. annotated with a dagger scope). This means, it doesn’t matter you inject
T in constructor of
Factory , because semantically these two things would result in same output: either you will receive the same “activity-wide”
T has scoping) or you will receive a new
T has no scoping).
Particularly in your case you should see no difference, because
MoviesPresenterFactory should be singleton, thus not being created for each new instance of
Let me know if you agree on these thoughts, or otherwise if I’m missing something please point that out.
Thanks for the post!