Spring第二天

第一节:spring ioc简介

IOC(控制反转:Inverse of Control),又称作依赖注入,是一种重要的面向对象编程的法则来削减计算机程序的耦合问题,也是轻量级的Spring框架的核心。

IOC:控制反转,指的是对象创建权反转(交给)Spring,作用是实现了程序的解耦合。

 

第二节:开发模式

 

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans.xsd">

<bean id="zhangsan" class="com.capchem.bean.ZhangSan"></bean> <bean id="dowork" class="com.capchem.service.DoWork"> <property name="zhangsan" ref="zhangsan"></property> </bean> </beans>

 

posted @ 2022-05-13 18:26  塞纳纽斯  阅读(13)  评论(0)    收藏  举报