spring 讲解
spring Ioc
Ioc就是Inversion of control --- 控制反转
它的意思就是将对象,以及对象之间的引用关系,交给容器管理,主要的注解有:
- @Comonet 没有明确声明角色的功能
- @Service 在业务逻辑层使用
- @Repository 在数据操作层使用
- @Controller 在表现层(SpringMvc中)使用,其中RestControlelr也是一样的含义
spring Di
DI是依赖注入,就是把容器中的对象拿出来,主要的注解有:
- @Autowired
- @Resource

浙公网安备 33010602011771号