MicroBean Configuration CDI

This is the third of a series of posts on some of the personal projects I’ve been working on.  As I hope you’ll see, they all fit together.  The previous post covered MicroBean Configuration.  The next post covers MicroBean CDI Utilities.

This post covers MicroBean Configuration CDI.  Its website is here, its source code is here and its binaries are available from Maven Central.

MicroBean Configuration CDI is a CDI 2.0 portable extension that adapts MicroBean Configuration API together with a backing implementation (such as MicroBean Configuration) to a CDI 2.0 environment.  In practical terms, this means users can inject configuration values into their CDI beans:

private Integer fred;

To install MicroBean Configuration CDI, place it in your classpath.  Make sure that you have a MicroBean Configuration API implementation, such as MicroBean Configuration, in your classpath as well.

In this respect, MicroBean Configuration CDI is no different from many other CDI-centric configuration frameworks, such as MicroProfile Config or DeltaSpike Configuration or Apache Tamaya’s CDI extension.

MicroBean Configuration CDI differs from these frameworks in its first-class surfacing of configuration coordinates (for more on configuration coordinates and the API that supports them, see my prior post on MicroBean Configuration API).  It also delegates the actual work of looking up configuration values to the underlying MicroBean Configuration API implementation (see MicroBean Configuration for one such implementation), so in itself is really just a thin layer that calls the API for you.

I hope you can see that these three projects—MicroBean Configuration API, MicroBean Configuration and MicroBean Configuration CDI—taken together or separately allow for easy usage of configuration values in your Java SE applications, including standalone CDI 2.0 applications.  These give us a helpful starting point for some of the other projects we’ll cover next in this series.

The next post covers MicroBean CDI Utilities, a tiny project at the moment that helps with a few simple CDI 2.0 tasks.


Author: Laird Nelson

Devoted husband and father; working on Helidon at the intersection of Java, Jakarta EE, architecture, Kubernetes and microservices at Oracle; open source guy; Hammond B3 player and Bainbridge Islander.

2 thoughts on “MicroBean Configuration CDI”

Comments are closed.

%d bloggers like this: