spring 实例 bean 的方式
一、使用构造器实例化:
<bean id="personService" class="cn.mytest.service.impl.PersonServiceBean"></bean>
二、使用静态工厂方法实例化:
<bean id="personService1" class="cn.mytest.service.impl.PersonServiceFactory" factory-method="createPersonServiceBean"></bean>
三、使用实例化工厂方法实例化:
<bean id="personServiceFactory" class="cn.mytest.service.impl.PersonServiceFactory"></bean>
<bean id="personService2" factory-bean="personServiceFactory" factory-method="createPersonServiceBean1">
<constructor-arg value="cdrw"/>
</bean>