How Spring is configured

1. XML Based Configuration

advantage:

     1) The XML configuration method further reduces the coupling and makes the application easier to expand. Even if the configuration file is further modified, the project does not need to be modified and recompiled.

     2) When dealing with large business volume, it should be better to use XML configuration.
     shortcoming:

     1) It takes a certain amount of time to read and parse the configuration file, and it is difficult to manage when there are too many configuration files.

     2) The correctness of the configuration cannot be verified, which increases the difficulty of testing.

2.Annotation-based configuration

3. Java-based configuration

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325784034&siteId=291194637