Replies: 3 comments
-
Beta Was this translation helpful? Give feedback.
-
Registering beans at runtime is not possible with ArC. You might be able to achieve some of your goals with the ArC extension API (or with CDI Build Compatible Extensions), but the extensions still execute at build time. |
Beta Was this translation helpful? Give feedback.
-
@Ladicek is right. It's not possible and will not be possible in the future due to the build-time nature of ArC (a design decision aligned with Quarkus philosophy and goals).
Unfortunately, you can only find very little "runtime dynamics" in ArC. There's a declaratively way to choose beans that can be obtained via programmatic lookup but again all the bean definitions must be available during the build. And that's pretty much it 🤷. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm considering a migration from a Guice like DI framework to Arc. In my target application, beans are declared and registered using a programmatic API not dissimilar to that of Guice. The following code is representative:
As a phased migration to Arc, I would like to create a
Registry
implementation backed by Arc, so the I can have Arc take on the responsibility of the DI without having to refactor the wiring/binding code (yet). Therefore, ideally I need to be able to register beans programmatically at runtime. Eventually I'd like to gradually move to declarative annotation based DI at build time, but for architectural reasons this has to be phased and not big-bang.My questions are:
Beta Was this translation helpful? Give feedback.
All reactions