3.Hello Spring
控制:传统,由程序员本身控制对象的创建,使用Spring后,对象由Spring来创建
反转:程序本身不创建对象,变成被动接收对象
依赖注入:利用set方法来进行注入
所谓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
https://www.springframework.org/schema/beans/spring-beans.xsd">
<bean id="..." class="...">
<!-- collaborators and configuration for this bean go here -->
</bean>
<bean id="..." class="...">
<!-- collaborators and configuration for this bean go here -->
</bean>
<!-- more bean definitions go here -->
</beans>