The thing to change with the XML does not change things with annotations; This is a good solution for using annotations or XML.
XML Usage Scenario:1. The external jar package relies on the bean configuration 2. Scenarios that cannot be implemented with annotations or that cannot be easily implemented with annotations 3. Place of agreement within the project group 4. Special configuration (such as: Define a map) Excellent: Easy to edit, configuration comparison centralized, easy to modify, in the large business volume of the system, through the XML configuration will be convenient for future generations to understand the whole system of the lack of architecture: more cumbersome, type unsafe, configuration is ugly, configuration file too many times difficult to manage
Annotation Usage Scenario: In addition to the above 4 points, other conditions can be used excellent: convenient, concise, configuration information and Java code together to help enhance the cohesion of the program. Missing: Dispersed to each class file, so it is not appropriate to maintain
Selection of Spring configuration files in the project (XML and annotation choices)