The JavaConfig approach provides an easier, straightforward and programmatical way of loading beans to the container. This approach uses annotations and classes to manage the lifespan of the objects, the dependencies, and the injection of values and objects to setters and constructors. The next recipe showcases how to construct and utilize a Java-based ApplicationContext container.
Managing beans in the JavaConfig container
Getting started
Let us create and use the ch02-jc project to create our first annotation-based ApplicationContext container. We will be using the same model classes presented in the recent recipe.