11
Leveraging CDI Beans to Manage Ports and Use Cases
Quarkus provides its own dependency injection solution called Quarkus DI. It stems from the Contexts and Dependency Injection (CDI) for Java 2.0 specification. We employ CDI to delegate the responsibility of providing object instances to an external dependency and managing their life cycle across an application. Several dependency injection solutions on the market take such responsibility. Quarkus DI is one of them.
The value of using a dependency injection mechanism is that we no longer need to worry about how and when to provide an object instance. A dependency injection solution enables us to automatically create and provide objects as dependencies in classes that depend on those objects, ...
Get Designing Hexagonal Architecture with Java - Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.