This video sets the expectation of what you learn in this chapter on legacy support for XML configuration.
- [Lecturer] If you look at any of the examples on Spring.io you won't see much if any XML configuration any more. Being a Spring user for so long I was not very happy about this at first and expressed my displeasure with several of the Spring contributors. The response was always the same. Things are changing for a reason and I must say in all honesty that my mind has not been changed as well. I no longer use XML configuration at all when creating new applications and that would be my advice to you as well.
So that all being said, you may ask why even do a chapter on XML configuration of Spring. And the answer is simple, because it is still supported. Not only does Spring still support XML configuration but, if you ever have to work on legacy applications you will run into this configuration style and having some basic knowledge will help you. XML configuration really has two main parts. The first is the bean configuration itself. In the XML configuration each bean you want to configure is a separate element in the XML document.
The configuration of a specific element within the bean is through the attributes and sub-elements of that bean. The second part of XML configuration is the namespaces used. Learning the namespaces will dramatically decrease the verbose XML configuration that you would need to create for more advanced areas of the Spring framework like integration, database access or other j2ee components. Well this isn't new functionality nor is it recommended for future use, you should at least have a cursory knowledge of this.
The next two videos should provide you enough knowledge to understand the documentation from Spring on this topic. I'm not trying to show you all the ins and outs of the configuration technology just the very basics.
- Introduction to Spring
- Configuring the ApplicationContext
- Using the Spring expression language
- Configuring proxies
- Autowiring beans
- Using lifecycle methods
- Configuring beans with XML
- Understanding the initialization phases of the bean lifecycle
- Aspect-oriented programming and Spring