Spring Boot takes advantage of @ Bean configuration

before using Spring, the interface has multiple implementation classes and uses xml to configure bean, so it is convenient to switch
. But it seems that SpringBoot recommends creating a new bunch of @ Configuration classes. What are the advantages of configuring Bean
in @ Bean way? Isn"t it troublesome to switch?

Apr.18,2022

my own experience: third-party things are registered directly by bean, but generally in the form of xml, so I haven't used @ Bean
for my own implementation is usually in the form of annotations, but not @ Bean, but @ Component lets Spring scan and manage it. If there are multiple interfaces, the
annotations and xml that are switched with @ Qualifier ("name") have their own advantages and disadvantages. Look at the meaning of your team. Just unify


. I think they are all the same. The @ Bean method is more flexible. After all, it is java code

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3acd7-3460d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3acd7-3460d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?