Let Spring XML file configuration simple measure

xiaoxiao2021-03-06  61

We always think that in the XML configuration file, we have set up N more bean. How can I manage my profile, make things simple? The method we think is to use autowiring. Typically, the solution is to add one in my properties.

AutoWire = "BYNAME" attributes and is already correctly named everything, then the dependency between them will be saved automatically. But I don't like this feature of "autowiring". The reason is that the Spring's XML file is a type of document that provides the type of dependency between my bean. If I configure anything

Auto-Wired will be lost as the value of this type of document. Then other users or later maintenance people will have to view class files (or javadocs) to select this dependency. So I still like to knock more words in the XML file, maybe it is convenient for future. Others can cause people to pay attention to the technology for simplified Spring's XML configuration files, huh, huh, huh, have not tried it yet.

转载请注明原文地址:https://www.9cbs.com/read-84869.html

New Post(0)