1. Migrating from Guice framework
Migration from Guice to Bootique DI is a straightforward process as they both share similar concepts. Essentially it all comes to changing packages and minor code rewrites.
2. Interfaces and Annotations
Here is a table that shows a correspondence of interfaces and annotations between Guice and Bootique DI.
Guice | Bootique |
---|---|
@com.google.inject.Inject |
@javax.inject.Inject |
@com.google.inject.BindingAnnotation |
@javax.inject.Qualifier |
@com.google.inject.Singleton |
@javax.inject.Singleton |
@com.google.inject.Named |
@javax.inject.Named |
@com.google.inject.Provides |
@io.bootique.di.Provides |
com.google.inject.Module |
io.bootique.di.BQModule |
com.google.inject.Binder |
io.bootique.di.Binder |
com.google.inject.Injector |
io.bootique.di.Injector |
com.google.inject.Provider |
javax.inject.Provider |
com.google.inject.Key |
io.bootique.di.Key |
com.google.inject.TypeLiteral |
io.bootique.di.TypeLiteral |
com.google.inject.multibindings.Multibinder |
io.bootique.di.SetBuilder |
com.google.inject.multibindings.MapBinder |
io.bootique.di.MapBuilder |
3. API changes
3.1. Binder API
Guice | Bootique |
---|---|
|
|
|
|
|
|
|
|
|
|
|
|
3.2. Multibinder
Guice | Bootique |
---|---|
|
|
|
|
|
|
|
|
|
|
3.3. MapBinder
Guice | Bootique |
---|---|
|
|
|
|
|
|
3.4. Injector API
Guice | Bootique |
---|---|
|
|
|
|
|
|
3.5. Module API
BQModuleProvider 1.x | BQModuleProvider 2.x |
---|---|
|
|
|
|