spring 学习总结

装配springbean

  依赖注入的三种方式(底层)

  1.构造器注入

  2.setter注入

  3.接口注入

  具体实现方式

  1.xml

  2.@Component @ComponentScan

  3.自动装配@Autowired

对于自己创建的bean,使用自动装配的方式。对于第三方的包和外部接口,使用xml方式

 

posted @ 2018-06-20 17:24  旋风冲锋ofo  阅读(122)  评论(0编辑  收藏  举报