![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
springboot
Java20180301
2018年8月4日 2 243 135 127万+
展开
-
控制反转和依赖注入 IoC & DI
先看一个书上的案例 简化一下,就是A这个类需要使用到B这个类的performAction() 方法,那么很简单: public class A{ private B; public void method(){ B b= new B(); b.performAction(); } } 这样做存在的问题:A和B直接耦合,于是: ...原创 2018-08-21 18:34:10 · 160 阅读 · 0 评论 -
Spring Boot 读取 properties 文件
读取自定义的 properties 文件中的数据到实体类 目录结构 代码 import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotat...原创 2019-09-20 14:29:16 · 162 阅读 · 0 评论