1.setter
service中get/set方法
配置中<property name="dao" ref ="d"/>
2.构造方法
service中写service(DAO dao){this.dao=dao}
配置中<constructor-arg> <ref bean="d"/></constructor-arg>
注入构造方法有多个参数(通过类型和索引)
3.接口注入