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:

@Inject
@ConfigurationValue("fred")
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.

Advertisements

2 thoughts on “MicroBean Configuration CDI

  1. Pingback: MicroBean CDI Utilities | Blame Laird

  2. Pingback: MicroBean Configuration | Blame Laird

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s