简体   繁体   English

Spring:-在Spring xml配置中使用@autowired注释和使用“ autowire”之间的主要区别是什么?

[英]Spring:- what is the main difference between using @autowired annotation and using “autowire” in spring xml configuration?

Lately, one junior developer asked me this question:"is there difference between using @autowired annotation and using "autowire" in spring xml configuration?" 最近,一个初级开发人员问我这个问题:“在Spring xml配置中使用@autowired注释和使用“ autowire”之间有区别吗?”

I am not able to give him an specific answer.Please help me. 我无法给他具体答案。请帮助我。

No. Spring offers multiple way of wiring up components. 不。Spring提供了多种组件连接方式。 Depending on your system build, some may offer more advantages over other. 根据您的系统构建,某些功能可能会提供比其他功能更多的优势。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用 @Autowired 和 AUTOWIRE_BY_TYPE 有什么区别? - What is the difference between using @Autowired and AUTOWIRE_BY_TYPE? 澄清在春季使用自动装配注释 - Clarification on using autowire annotation in spring 这两个Spring Annotation和XML配置有什么区别 - What is difference between these 2 Spring Annotation and XML config spring 引导如何使用 @Autowired 没有 @Component 注释和 xml 配置注入 ApplicationContext 和 JdbcTemplate 的实例? - How does spring boot inject the instance of ApplicationContext and JdbcTemplate using @Autowired without @Component annotation and xml configuration? 将@Transaction注释与@Autowired一起使用-Spring - Using @Transaction annotation with @Autowired - Spring 在 spring 引导中自动装配的 class 上自动装配和使用新关键字之间的区别? - Difference between autowired and using new keyword on autowired class in spring boot? 在 spring 主应用程序中使用 @Autowired - Using @Autowired in the spring main application 使用@Qualifier批注和在Spring中直接注入bean有什么区别? - What is the difference between using @Qualifier annotation and directly injecting bean in spring? 在 Spring 中自动装配注释而不使用组件扫描 - Autowire Annotation in Spring without using Component Scanning 在春季启动中使用@autowire注释会引发'BeanCreationException' - Using @autowire annotation in spring boot is throwing 'BeanCreationException'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM