SPRING.NET 1.3.2 学习13--value和ref的简写形式

property常规写法:

<property name="myProperty">
      <value>hello</value>
</property>
<constructor-arg> 
  <value>hello</value>
</constructor-arg> 
<entry key="myKey">
  <value>hello</value>
</entry>

简写:

<property name="myProperty" value="hello"/>
<constructor-arg value="hello"/> 
<entry key="myKey" value="hello"/>


ref常规写法:

<property name="myProperty"> 
  <ref object="anotherObject"/>
</property>
<constructor-arg index="0"> 
  <ref object="anotherObject"/> 
</constructor-arg>

简写:

<property name="myProperty" ref="anotherObject"/>
<constructor-arg index="0" ref="anotherObject"/>

key ref常规写法:

<entry> 
  <key>
     <ref object="MyKeyObject"/>
  </key> 
  <ref object="MyValueObject"/> 
</entry>

简写:

<entry key-ref="MyKeyObject" value-ref="MyValueObject"/>



 

你可能感兴趣的:(SPRING.NET 1.3.2 学习13--value和ref的简写形式)