<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"??? " ///////在spring里所有的bean都是具體的實(shí)現(xiàn),所謂的裝配bean就是裝配一個(gè)具體的實(shí)現(xiàn)<beans>? <bean id="quest"????? class="com.springinaction.chapter01.knight.HolyGrailQuest"/>/////轉(zhuǎn)配一個(gè)實(shí)現(xiàn)類,用來(lái)實(shí)現(xiàn)一個(gè)接口 ? <bean id="knightTarget"????? class="com.springinaction.chapter01.knight.KnightOfTheRoundTable">??? <constructor-arg>????? <value>Bedivere</value>??? </constructor-arg>??? <property name="quest">////這里是裝備一個(gè)這個(gè)類的屬性????? <ref bean="quest"/>??? </property>? </bean>? ? <bean id="minstrel"????? class="com.springinaction.chapter01.knight.MinstrelAdvice"/>????? ? <bean id="knight"????? class="org.springframework.aop.framework.ProxyFactoryBean">??? <property name="proxyInterfaces">????? <list>??????? <value>com.springinaction.chapter01.knight.Knight</value>????? </list>??? </property>??? <property name="interceptorNames">????? <list>??????? <value>minstrel</value>????? </list>??? </property>??? <property name="target"><ref bean="knightTarget"/></property>? </bean>? </beans>在spring 里所有的類都要實(shí)現(xiàn)接口與具體實(shí)現(xiàn)的分離? iGoHome.java?? iGoHomeImp.java? 這兩個(gè)類來(lái)具體完成 大盤預(yù)測(cè) 國(guó)富論
///////在spring里所有的bean都是具體的實(shí)現(xiàn),所謂的裝配bean就是裝配一個(gè)具體的實(shí)現(xiàn)<beans>? <bean id="quest"????? class="com.springinaction.chapter01.knight.HolyGrailQuest"/>/////轉(zhuǎn)配一個(gè)實(shí)現(xiàn)類,用來(lái)實(shí)現(xiàn)一個(gè)接口
? <bean id="knightTarget"????? class="com.springinaction.chapter01.knight.KnightOfTheRoundTable">??? <constructor-arg>????? <value>Bedivere</value>??? </constructor-arg>??? <property name="quest">////這里是裝備一個(gè)這個(gè)類的屬性????? <ref bean="quest"/>??? </property>? </bean>? ? <bean id="minstrel"????? class="com.springinaction.chapter01.knight.MinstrelAdvice"/>????? ? <bean id="knight"????? class="org.springframework.aop.framework.ProxyFactoryBean">??? <property name="proxyInterfaces">????? <list>??????? <value>com.springinaction.chapter01.knight.Knight</value>????? </list>??? </property>??? <property name="interceptorNames">????? <list>??????? <value>minstrel</value>????? </list>??? </property>??? <property name="target"><ref bean="knightTarget"/></property>? </bean>? </beans>在spring 里所有的類都要實(shí)現(xiàn)接口與具體實(shí)現(xiàn)的分離? iGoHome.java?? iGoHomeImp.java? 這兩個(gè)類來(lái)具體完成