javadependency-injectioncdiguicehelidon

Can you use alternative dependency injection frameworks with Helidon MP?


I'm getting started with Helidon MP and for the most part its pretty sweet. I'm not a huge fan of the CDI system as I have extensive experience with Guice in past projects.

I've been trying to figure out how to re-wire dependency injection for Helidon MP to use something like Guice or Dagger2 but I cannot find anything online that documents how you would do this.

Is this even possible? Or do I switch to Helidon SE and wire it all up myself?


Solution

  • Yes, but MicroProfile requires the presence of CDI, so as long as you continue to use a MicroProfile implementation (such as Helidon MP) CDI must be in the picture. Might be better to just embrace it rather than shipping an application or a library with several dependency injection frameworks of which only one will be active.