随笔分类 -  Spring

About Spring
摘要:Bean的作用域,在bean标签中的scope进行设定 <bean id="accountService" class="com.something.DefaultAccountService" scope="prototype"/> 单例:无论取出都少个Bean都指向一个实例,Spring的默认模 阅读全文
posted @ 2020-05-08 12:42 Tudoo 阅读(231) 评论(0) 推荐(0)
摘要:@Data public class Student { private String name; private Address address; private String[] books; private List<String> hobbies; private Map<String,St 阅读全文
posted @ 2020-05-07 20:20 Tudoo 阅读(201) 评论(0) 推荐(0)
摘要:控制反转(Inversion of Control,缩写为IoC) 如果程序写死,那么用户每提出一个新的要求,程序员都需要修改源代码。 比如,现在有教师类Teacher和学生类Student 那么,用户要获取教师时候,伪代码为 public class UserServiceImpl impleme 阅读全文
posted @ 2020-03-23 00:05 Tudoo 阅读(209) 评论(0) 推荐(0)
摘要:原因是没有给方法添加修饰符,在方法上添加public即可 阅读全文
posted @ 2019-11-04 19:03 Tudoo 阅读(8314) 评论(4) 推荐(1)