MicroBean Configuration API is a Java SE API that abstracts over collections of configuration values. In this regard it is no different from many other Java configuration APIs. Like many other configuration frameworks, configuration values are always
Strings and can be converted.
Where perhaps it is different is: it expresses configurations—collections of configuration values—in terms of their location in configuration space as determined by configuration coordinates. Other systems tend to use hierarchies of configuration values, but of course configuration space is not hierarchical so there are always problems with the hierarchical approach.
(Also, other systems use configuration coordinates whether they are fully cognizant of what they’re doing or not—one only has to look at the separation of “user” from “system” values in systems like the Java Preferences API.)
Configuration space as an abstract concept is the universe of all configurations. Some configurations are suitable for certain application deployments and many are not. Usually there’s one that is suitable for nearly all application deployments of a particular kind, but that one is generally very “defaultish” (one step away from hard-coded values). For a given application deployment, you want, of course, the maximally specific configuration to apply to it. To pick this configuration out from all others, you supply configuration coordinates that locate your application deployment in configuration space, and then MicroBean Configuration API finds the most specific or suitable configuration that exists for it.
Sometimes an application is aware of its own configuration coordinates, or the configuration coordinates that it wants to use when seeking a configuration value. Other times—the vast majority of times—it is not (they are specified “outside” of it, as in the case of other Java configuration frameworks where you “pass in” notions of a “project stage” or other means of locating configuration values suitable for the deployment). MicroBean Configuration API offers two fundamental flavors of the
getValue() method (with convenience overrides) for these two cases: one for getting a configuration value when the configuration coordinates are known, and one for when they are supplied implicitly.
To make MicroBean Configuration API work, you’ll need a concrete implementation of it. Currently there is one implementation—MicroBean Configuration—which is two things: one, a concrete implementation of MicroBean Configuration API, of course, and two, a multiplexing variant of it (i.e. it can front many other configuration systems). We’ll cover MicroBean Configuration in the next post.