Spring has made it so that configuring an ApplicationContext
is extremely flexible. There are numerous ways to apply each type of configuration, and they can all be mixed and matched together nicely.
Java configuration is a form of explicit configuration. A @Configuration
annotated class is used to specify the beans that will be a part of the ApplicationContext
, as well as define and wire the dependencies of each bean.
Xml configuration is a form of explicit configuration. A specific xml schema is used to define the beans that will be a part of the ApplicationContext
. This same schema is used to define and wire the dependencies of each bean.
Autowiring is a form of automatic configuration. Certain annotations are used in class definitions to establish what beans will be a part of the ApplicationContext
, and other annotations are used to wire the dependencies of these beans.