Why use "value" but not "ref" for property value in spring.net config

137 Views Asked by At

Recently when I read the Spring.net's documentation. I found there is one place that is quite confusing to me. In 5.3.2.1.1, the doc said as below:

<object id="theTargetObject" type="...">     . . . </object>

<object id="theClientObject" type="...">   
    <property name="targetName"> 
        <idref object="theTargetObject"/>
    </property>
</object> 

This above object definition snipped is exactly equivalent (at runtime) to the following snippit:

<object id="theTargetObject" type="...">    . . . </object>

<object id="theClientObject" type="...">      
      <property name="targetName" value="theTargetObject"/>
</object>

I think there is a mistake here, in the second code snippet, the attribute "value" should be "ref" as its value refers to the theTargetObject and not a raw string value. Am I right? Thank you for anyone who is verifying that.

1

There are 1 best solutions below

1
IcyBrk On BEST ANSWER

I did test and find in that scenario using value is not correct, it should be "ref" or "idref".