From your example, I can’t clearly see how @Bind
is better than @Provides
The reason is, I see we could also make @Provides
as following: -
@Module
public class HomeModule { @Provides
public HomePresenter providesHomePresenter(HomePresenterImpl homePresenterImpl){
return homePresenterImpl;
}
}
Using this approach, even if UserService
is added to HomePresenterImpl
, we don’t need to change the HomeModule
.
This would then make @Bind
doesn’t seems to be much of advantage compare to @Provides
.
Did I miss anything?