@configuration和@component之间的区别

@configuration和@component之间的区别是:@Component注解的范围最广,所有类都可以注解,但是@Configuration注解一般注解在这样的类上:这个类里面有@Value注解的成员变量和@Bean注解的方法,就是一个配置类。

@component多例的,@configuration是单例的

posted @ 2019-01-23 09:41  Booker808  阅读(3063)  评论(0编辑  收藏  举报