降低组建之间的解哦控制事务
提供单例模式
AOP面向切面
辅助类
对主流框架支持
<?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-2.5.xsd">
<bean id="personService" class="net.itdos.service.impl.PersonServiceBean"></bean>
</beans>
ApplicationContext ctx = new ClassPathXmlApplicationContext("beans.xml");
PersonService personService = (PersonService)ctx.getBean("personService");
personService.save();
对配置文件读取
反射实例化bean
三种实例化方式
1调用默认构造器
2静态工厂
3实例工厂