I have recently discovered a great feature in Spring:
<property name="propertyToSet">This is much nicer in my opinion than
<util:property-path path="aBean.aProperty"/>
</property>
<property name="propertyToSet">It is also more powerful because you can do things like
<bean factory-bean="aBean" factory-method="getAProperty"/>
</property>
<property name="propertyToSet">which otherwise would have been awkward.
<util:property-path path="aBean.aProperty.aNestedProperty"/>
</property>
However I do want an improvement. I want a yet more concise syntax for this. Spring can already do this:
<property name="aPropertyToSet" value="true"/>So it would only be logical (and very-very nice!) if it could also do this:
<property name="aPropertyToSet" ref="anotherBean"/>
<property name="propertyToSet" path="aBean.aProperty"/>
1 comment:
1/ adding "path" will make Spring beginner confused, and will require significant update to Spring docs, I think.
2/ Spring 3 has introduce "Expression Language" feature, and it is sufficient for such config :)
http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/expressions.html
just my 2 cents
Post a Comment