首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 软件管理 > 软件架构设计 >

Spring 2.5.6引见(七)——自动装载constructo模式

2012-08-24 
Spring 2.5.6介绍(七)——自动装载constructo模式package cn.csdn.servicepublic class AddressServiceImpl

Spring 2.5.6介绍(七)——自动装载constructo模式

package cn.csdn.service;public class AddressServiceImpl { private String address; public void setAddress(String address) { this.address = address; }}

package cn.csdn.service;public class EmpServiceImpl {private AddressServiceImpl addressServiceImpl ; public EmpServiceImpl(AddressServiceImpl addressServiceImp){this.addressServiceImpl = addressServiceImpl;}}

<?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.0.xsd"> <bean id="addressServiceImpl" scope="singleton" autowire="constructo "> </bean></beans>

?

热点排行