1.1编写流程
01:导入jar包:
02:编写目标类:dao和service
03:spring配置文件
Ioc:<bean id=”” class=””>
DI:<bean> <property name=”” value=”” ref=””>
实例化方式:
默认构造:
静态工厂:<bean id=”” class=”工厂类”factory-method=”静态方法”>
实例工厂:<bean id=”工厂” class=”工厂类”> <bean id=””factory-bean=”工厂”id factory-bean=”方法”>
作用域:<bean id=”” class=”” scope=”singleton|prototype”>
生命周期:<bean id =“” class=””init-method=””destroy-method=””>
后处理bean BeanPostProressor接口,<bean class=””注册>,对容器所有的bean都生效