Issue Details (XML | Word | Printable)

Key: SPRNET-378
Type: New Feature New Feature
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Aleksandar Seovic
Reporter: Erich Eichinger
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Spring.NET

Enable Spring.Expressions to be used for DI

Created: 24/Oct/06 02:42 AM   Updated: 03/Dec/06 11:29 AM   Resolved: 06/Nov/06 02:05 PM
Component/s: Spring-NET-CORE
Affects Version/s: 1.1 P3
Fix Version/s: 1.1 P3

Time Tracking:
Not Specified

Issue Links:
Duplicate
 


 Description  « Hide
Forum Thread: http://forum.springframework.net/showthread.php?p=3533

What about adding some "ExpressionFactoryObject" to Spring.Core? Since expressions are a real mighty tool, one could easily inject many things with less xml-verbosity.

My suggestion is adding a new ExpressionEvaluationFactoryObject and a corresponding alias to Spring.Core to enable writing something like this:

<property name="TestData"><value type="ExpressionEvaluatingFactoryObject">String.Empty</value></property>

Bruno's suggestion:

<property name="TestData"><eval>String.Empty</eval></property>



Aleksandar Seovic added a comment - 06/Nov/06 02:05 PM
Added support for expression evaluation when setting constructor argument and property values. Both attribute and nested element are supported, just like for other tags:

  <object id="to1" type="Spring.Objects.ExpressionTestObject, Spring.Core.Tests">
    <constructor-arg name="someString" expression="date('1974-08-24').ToString('m')"/>
    <property name="SomeDate" expression="date('2004-08-14', 'yyyy-MM-dd')"/>
  </object>

  <object id="to2" type="Spring.Objects.ExpressionTestObject, Spring.Core.Tests">
    <constructor-arg name="someString">
      <expression>date('1974-08-24').ToString('m')</expression>
    </constructor-arg>
    <property name="SomeDate">
      <expression>date('2004-08-14', 'yyyy-MM-dd')</expression>
    </property>
  </object>

- Aleks