spring学习笔记
文章平均质量分 50
Gavin-Ng
潜修中,攻克java微服务和大数据
展开
-
Spring中Configurartion和Component的区别
@Configuration和@Component的区别@Configurationpublic class MyTestConfig { @Bean public Driver driver(){ Driver driver = new Driver(); driver.setId(1); driver.setName("driver"); driver.setCar(car()); return dri原创 2021-06-16 18:45:48 · 124 阅读 · 0 评论 -
Springboot中获取所有Bean对象的方法
方法一:实现ApplicationContextAwarepackage com.example.demo.pojo;import org.springframework.beans.BeansException;import org.springframework.context.ApplicationContext;import org.springframework.context.ApplicationContextAware;import org.springframework...原创 2021-06-13 16:01:26 · 2979 阅读 · 0 评论 -
Spring框架学习笔记
spring-框架详解一.Spring-基本概念,原理,基本配置1.Spring的核心思想(IOC和AOP)IOC:开发人员在容器中,既代码之外管理对象,给属性赋值,管理依赖 -依赖注入:开发人员在项目中只需要提供对象的名称,对象的创建和赋值都由容器内部实现AOP:aop就是面向切面编程,将日志、事务等相对独立且重复的功能抽取出来,利用Spring的配置文件或者注解的形式将这些功能织入进去,提高了复用性2.spring配置文件内容和pom.xml依赖spring.xml配置文件&l原创 2021-03-07 22:36:06 · 247 阅读 · 1 评论