Results 1 to 3 of 3

Thread: Change request: compound properties on the right side

  1. #1

    Default Change request: compound properties on the right side

    Spring supports "compound property names" like here:

    Code:
    <bean id="foo" class="foo.Bar">
      <property name="fred.bob.sammy" value="123"/>
    </bean>
    But it doesn't support compound names on the right side, like here:

    Code:
      <property name="contract" ref="txContext.user.contract"/>
    where txContext is another bean defined in Spring configuration, and user = getUser(), and contract = getContract()

    I'd happy to have that. It would make a population of multiple handlers from one input context a much easer task. Besides, it's just more uniform -- the same expression is supported on both sides of the assignment.

  2. #2
    Join Date
    Aug 2004
    Posts
    2,715

    Default

    The idea is not bad. However I see a problem here.
    The reference could be a name containing dots. So there would be a compatibility conflict if suddenly dots would be interpreted specially.

    Regards,
    Andreas

  3. #3

    Default

    there is a space for compatibility problem, but not that big:

    if we have a ref="a.b.c", and there is a bean "a.b.c", and the property is assignable from the bean "a.b.c", then use the bean itself.

    to have a conflict there must be two bean of the same type, one having name matching a substring of another, and having property of the same type, and matching the rest of the name of the first bean:

    Code:
    <bean id="foo.bar" class="Foo"/>
    
    <bean id="foo" class="Foo">
      <property name="bar" class="Foo"/>
    </bean>
    
    ...
      <property name="x" ref="foo.bar"/> <!-- conflict -->
    but there is a simple way to keep the compatibility:

    Code:
      <property name="x" ref="foo" refproperty="bar"/>

Similar Threads

  1. FlowExecutionStorage in a DB
    By cacho in forum Web Flow
    Replies: 7
    Last Post: Oct 19th, 2009, 03:36 PM
  2. Binding composite properties with DataBinder
    By dhewitt in forum Architecture
    Replies: 16
    Last Post: Jun 1st, 2007, 06:22 AM
  3. Hibernate Long Session Per Flow?
    By akw in forum Web Flow
    Replies: 21
    Last Post: Dec 12th, 2005, 08:06 PM
  4. Replies: 9
    Last Post: Nov 1st, 2005, 10:36 PM
  5. Loosing my SecureContext
    By sklakken in forum Security
    Replies: 3
    Last Post: Jul 21st, 2005, 01:44 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •