With Google Guice or Gin I can specify parameter with are not controlled by the dependency injection framework:
class SomeEditor {
@Inject
public SomeEditor(SomeClassA a, @Assisted("stage") SomeClassB b) {
}
}
The assisted parameter stage
is specified at the time an instance of SomeEditor
is created.
The instance of SomeClassA is taken from the object graph and the instance of SomeClassB is taken from the caller at runtime.
Is there a similar way of doing this in Dagger?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…