# On the Road to CDI Compatibility

DevFeed: [On the Road to CDI Compatibility](<https://devfeed.tech/articles/on-the-road-to-cdi-compatibility-43643.md>)

Original publisher: [Read original article](<https://quarkus.io/blog/on-the-road-to-cdi-compatibility/>)

Author: Ladislav Thon

Published: 2023-07-12T00:00:00Z

Content type: article

Language: en

Sources: [Quarkus - Supersonic Subatomic Java](<https://devfeed.tech/sources/quarkus-supersonic-subatomic-java.md>)

Topics: [Quarkus](<https://devfeed.tech/topics/quarkus.md>), [Dependency injection](<https://devfeed.tech/topics/dependency-injection.md>), [Dagger](<https://devfeed.tech/topics/dagger.md>), [Framework](<https://devfeed.tech/topics/framework.md>)

Tags: [build](<https://devfeed.tech/tags/build.md>), [dagger](<https://devfeed.tech/tags/dagger.md>), [dependency-injection](<https://devfeed.tech/tags/dependency-injection.md>), [framework](<https://devfeed.tech/tags/framework.md>)

## AI overview

The article explains Quarkus's ArC dependency injection container and its build-time architecture. It contrasts ArC with runtime-oriented CDI implementations such as Weld and Guice, and with Dagger's build-time dependency wiring, while discussing CDI Portable Extensions as a compatibility challenge.

## Source excerpt

Ever since the very first days of Quarkus, the days that are now covered by the blissful fog of oblivion and the survivors only talk about them after a few pints of beer, dependency injection container was an integral part of the envisioned framework. And not just any dependency injection container -- a CDI implementation, of all things. At the very beginning, the CDI implementation used was Weld. Very soon, the Masterminds and Deep Thoughts behind the CDI work in what eventually became Quarkus, Martin Kouba and Stuart Douglas, realized that Weld cannot possibly unlock the full potential that a build-time oriented framework conceals. Thus, ArC was born. When I first heard of ArC, I thought, surely that means A reduced CDI, especially with that capitalization! Alas, I was deeply mistaken. It is a reference to an activity that I could never possibly indulge in out of the simple concern for my health and safety: arc welding. (That indeed is a backreference to Weld. There are some clever people here!) Arc Welding ArC started with one important architectural constraint that was significantly different to all other existing CDI implementations at that time: it ought to perform the heavy lifting during application build. Among others, this includes the entire bean discovery process. If you are familiar with AtInject and its various implementations, this concept doesn't come as a surprise. For example, Guice is a popular dependency injection container that does all the work at application runtime, while Dagger is a popular alternative that precomputes dependency wiring at build time. With CDI, the situation is not that simple. CDI 2.0, the latest version at that time, includes features that ultimately preclude running bean discovery at build time; most notably, the Portable Extensions API. To be able to execute portable extensions, you need to have a running CDI container (to deliver events or use the BeanManager API), you need to be able to reflect on application classes (t