I have read many blogs but still i am not able to figure out @Module
annotation functioning in dagger.
@Inject
i got that it provides dependency injection at runtime. But what does @Module
does.
since the object graph is also built on module.
For ex i.e i have this snippet of code from https://github.com/AndroidBootstrap/android-bootstrap.
@Module(
complete = false,
injects = {
BootstrapApplication.class,
BootstrapAuthenticatorActivity.class,
MainActivity.class,
BootstrapTimerActivity.class,
}
)
public class BootstrapModule {
}
so what does it basically does. since i am also trying to build one application using dagger as dependency injection for android.But since I am not able to get @Module
concept clearly I am just stuck.
Can anyone please help me out with some basic example or concept. I think this will be helpful for all who is using dagger.
I guess Annotation Processing Tool requires that to generate code at the compile time. This makes it Dagger can provide validation at compile time and not only at runtime.