摘要: 1.Spring bean组件 ”默认为单例模式scope=“singleton, 运行JavaApplication容器启动时自动创建对象 scope=“prototype”为多例模式,请求条件下才创建对象 2beans组件 里面default-init-method初始化方法加载,范围比较大,当 阅读全文
posted @ 2020-06-14 22:54 TracyDemo 阅读(234) 评论(0) 推荐(0)
摘要: //单例模式 public class SingletonTest { /* //饿汉式 私有的静态对象 private static SingletonTest single=new SingletonTest(); //私有的构造方法 private SingletonTest() { // T 阅读全文
posted @ 2020-06-14 21:09 TracyDemo 阅读(111) 评论(0) 推荐(0)
摘要: 1.什么是Spring IOC,以及Spring IOC的作用inversion of control控制反转new 对象创建对象 ,转化为由容器注入对象降低耦合度 2.如何创建Spring 容器,以及Spring容器如何让获取Bean对象ApplicationContext appContext= 阅读全文
posted @ 2020-06-14 21:01 TracyDemo 阅读(1019) 评论(0) 推荐(0)