'. '

CDI

From APIDesign

(Difference between revisions)
Jump to: navigation, search
(New page: CDI stands for Contexts and Dependency Injection. Referenced implementation is provided by Weld. Used by Helidon - even in NativeImage mode.)
Current revision (02:47, 5 April 2022) (edit) (undo)
 
Line 1: Line 1:
[[CDI]] stands for Contexts and [[Dependency Injection]]. Referenced implementation is provided by [[Weld]]. Used by [[Helidon]] - even in [[NativeImage]] mode.
[[CDI]] stands for Contexts and [[Dependency Injection]]. Referenced implementation is provided by [[Weld]]. Used by [[Helidon]] - even in [[NativeImage]] mode.
 +
 +
[[Helidon]] MP implements the [[MicroProfile]] specification based on various other standard [[JavaEE]] subspecifications including [[CDI]]. Getting [[Weld]] (the reference [[CDI]] specification) running on top of [[NativeImage]] is particularly tricky. Not only [[Weld]] dynamically scans for various annotations, but it also dynamically emits [[bytecode]] for its helper classes during runtime. Solving this required more insight into [[JavaEE]] than available among compiler engineers - not that [[I]] had it initially, but the close co-operation with Tomáš Langer (the [[Helidon]] lead engineer) helped us move forward. Tomáš prepared various trivial [[CDI]] sample projects and [[I]] was then able to get them running on [[NativeImage]] by writing a dedicated '''WeldFeature'''. Once the initial road block was gone the [[Helidon]] team was able to move forward on their own and get their enhanced [[Weld]] running on top of [[NativeImage]].
 +
 +
[[Helidon]] 2.0 [https://medium.com/helidon/announcing-helidon-2-0-19c245f5488a was released] on June 24, 2020. It's [[MicroProfile]] edition (including compatible [[CDI]] implementation) works with [[NativeImage]].

Current revision

CDI stands for Contexts and Dependency Injection. Referenced implementation is provided by Weld. Used by Helidon - even in NativeImage mode.

Helidon MP implements the MicroProfile specification based on various other standard JavaEE subspecifications including CDI. Getting Weld (the reference CDI specification) running on top of NativeImage is particularly tricky. Not only Weld dynamically scans for various annotations, but it also dynamically emits bytecode for its helper classes during runtime. Solving this required more insight into JavaEE than available among compiler engineers - not that I had it initially, but the close co-operation with Tomáš Langer (the Helidon lead engineer) helped us move forward. Tomáš prepared various trivial CDI sample projects and I was then able to get them running on NativeImage by writing a dedicated WeldFeature. Once the initial road block was gone the Helidon team was able to move forward on their own and get their enhanced Weld running on top of NativeImage.

Helidon 2.0 was released on June 24, 2020. It's MicroProfile edition (including compatible CDI implementation) works with NativeImage.

Personal tools
buy