Here is an example that I have -
public class GinDemoPresenter implements Presenter {
private View view;
@Inject
public GinDemoPresenter (View view) {
this.view = view;
}
....
}
public class GinDemoView implements View {
private Presenter presenter;
@Inject
public GinDemoView(Presenter presenter) {
this.presenter = presenter;
}
....
}
During compilation I see this -
...
Cycle detected in the dependency graph. Consider using a Provider?
...
Can someone provide an example of how to resolve circular dependency in GIN?
The easiest way would be following pattern:
I would suggest to decouple the
View
from thePrensenter
, by introducing interfaces.