|
From: Dmitriy K. <dko...@ru...> - 2004-10-04 21:53:02
|
Rod, if it's not a secret, what strategy did you use to configure a constant value via a property? Did you utilize org.springframework.core.Constants class in conjunction with MethodInvokingFactoryBean? +1 for support to easily evaluate a constant in application context. Regards, Dmitriy. Rod Johnson wrote: >Have to say that this looks to me like it's making a case for an expression >language instead of a FactoryBean. > >A similar requirement that would also be well addressed by OGNL/whatever: >evaluating a constant. E.g. an AutowireCapableBeanFactory constant, which I >recently had to configure via a property. It would be nice to be able to do >that easily. > >Rgds >Rod > >-----Original Message----- >From: spr...@li... >[mailto:spr...@li...] On Behalf Of >Colin Sampaleanu >Sent: 04 October 2004 18:32 >To: spr...@li... >Subject: Re: [Springframework-developer] PropertyPathFactoryBean > >Good stuff. It overlaps of course with the mythical OGNL or expression >support which keeps getting pushed back, but in the meantime provides some >of the benefits for pretty little extra code... > > >jürgen höller [werk3AT] wrote: > > > >>I've just added a PropertyPathFactoryBean, following this suggestion: >> >>http://opensource.atlassian.com/projects/spring/browse/SPR-343 >> >> >>Usage examples: >> >>// target bean to be referenced by name <bean id="tb" >>class="org.springframework.beans.TestBean" singleton="false"> >> <property name="age"><value>10</value></property> >> <property name="spouse"> >> <bean class="org.springframework.beans.TestBean"> >> <property name="age"><value>11</value></property> >> </bean> >> </property> >></bean> >> >>// will result in 12, which is the value of property 'age' of the >>inner bean <bean id="propertyPath1" >> >> >class="org.springframework.beans.factory.config.PropertyPathFactoryBean"> > > >> <property name="targetObject"> >> <bean class="org.springframework.beans.TestBean"> >> <property name="age"><value>12</value></property> >> </bean> >> </property> >> <property name="propertyPath"><value>age</value></property> >></bean> >> >>// will result in 11, which is the value of property 'spouse.age' of bean >> >> >'tb' > > >><bean id="propertyPath2" >> >> >class="org.springframework.beans.factory.config.PropertyPathFactoryBean"> > > >> <property name="targetBeanName"><value>tb</value></property> >> <property name="propertyPath"><value>spouse.age</value></property> >></bean> >> >>// will result in 10, which is the value of property 'age' of bean 'tb' >><bean id="tb.age" >>class="org.springframework.beans.factory.config.PropertyPathFactoryBea >>n"/> >> >> >>The last one, interpreting the bean name as 'beanName.property' pattern, is >> >> >quite concise... > > >> >> >> >> > > > > >------------------------------------------------------- >This SF.net email is sponsored by: IT Product Guide on ITManagersJournal Use >IT products in your business? Tell us what you think of them. Give us Your >Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more >http://productguide.itmanagersjournal.com/guidepromo.tmpl >_______________________________________________ >Springframework-developer mailing list >Spr...@li... >https://lists.sourceforge.net/lists/listinfo/springframework-developer > > > > > >------------------------------------------------------- >This SF.net email is sponsored by: IT Product Guide on ITManagersJournal >Use IT products in your business? Tell us what you think of them. Give us >Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more >http://productguide.itmanagersjournal.com/guidepromo.tmpl >_______________________________________________ >Springframework-developer mailing list >Spr...@li... >https://lists.sourceforge.net/lists/listinfo/springframework-developer > > |