This is a multi-module maven project demonstrating how to use a variety of different DI frameworks by utilizing JSR-330 annotations.
Run one of the Main
classes in one of the impl
modules.
>help
Available commands:
- current
- remote
- where
>where
38, -77
>current
Temperature: 83.00'F
Forecast: Chance Showers And Thunderstorms
Wind: South 7.00mph
Core: JSR-330:
Core
holds the demo project, a weather forecast command line application.Core-Avaje
is a modified version ofCore
that specifies theavaje-inject-generator
processor in thepom.xml
.
Core: Custom annotations:
Core-HK2
is a modified version ofCore
that specifies thehk2-metadata-generator
processor in thepom.xml
, and uses@Service
/@Contract
from HK2.Core-Inverno
is a modified version ofCore
that specifies theinverno-core-compiler
processor in thepom.xml
, and uses@Bean
from Inverno.
Implementations
Impl-Avaje
- Using Avaje-Inject framework to generate code for DI.Impl-Dagger
- Using Dagger framework to generate code for DI.Impl-Dirk
- Using Dirk to reflectively populate injected instances.Impl-Feather
- Using Feather to reflectively populate injected instances.Impl-Guice
- Using Guice to reflectively populate injected instances.Impl-HK2
- Using Glassfish HK2 to use a service-loader to discover and inject instances.Impl-Inverno
- Using Inverno framework to generate code for DI from amodule-info
file.Impl-JayWire
- Using JayWire to manually populate injected instances.Impl-JBock
- Using JBock to generate code for DI, with mostly pre-defined existing module implementation.Impl-Spring
- Using Spring Boot to reflectively populate injected instances.Impl-Weld
- Using Weld to reflectively populate injected instances.