随笔分类 -  spring

摘要:##1.BeanDefinition 包含bean的一些基本元信息,如bean的类型,作用域,初始化方法...等等。 申明式的定义,如@Bean,等等 <bean class="com.test.service.UserService" id="userService" scope="prototy 阅读全文
posted @ 2022-11-12 22:08 Chcode 阅读(49) 评论(0) 推荐(0) 编辑
摘要:1.对于非懒加载的单利bean,在spring容器启动时就已经创建。 // 创建一个Spring容器 AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext(AppC 阅读全文
posted @ 2022-11-06 22:55 Chcode 阅读(108) 评论(0) 推荐(0) 编辑
摘要:spring创建对象 UserService.class ->无参构造方法->得到对象->依赖注入(属性赋值)->初始化前方法(@PostConstruct)->初始化方法(InitializingBean)->初始化后(AOP)->bean 默认调用类的无参构造方法,得到一个对象,此时对象内的其他 阅读全文
posted @ 2022-11-05 22:55 Chcode 阅读(39) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示