|
From: Marc L. <ma...@lo...> - 2005-04-08 22:30:18
|
Hi, i ve followed with great interest the xml namespace discussion today and my concern is also in the area of xml verbosity. While looking at my context XML files (which allready reached 800 lines after 3 weeks of project programming), i saw that i have plenty of definitions which go like this: <bean...> <property name="logisticProviderManagerService"><ref bean="logisticProviderManagerService"/></property> </bean> If its not only me who prefers (whenever possible) to have the same attribute name than the bean name/id, it would be nice to have something like this: <bean...> <property name="logisticProviderManagerService" refbean="true"/> </bean> or <property name="logisticProviderManagerService" bean="ref|local"/> But i really dont know how many others do it this way. So i dont know if this is of common interest here. If its not of common interest, or if i feel that this is a must have, i assume that the package org.springframework.beans.factory.xml is my friend right? ;-) -- regards Marc Logemann http://www.logemann.org http://www.logentis.de |
|
From: Juergen H. <ju...@in...> - 2005-04-08 22:40:59
|
Well, if it's about avoiding to express the "logisticProviderManagerService" name twice: why not use autowiring-by-name? This can be defined on a per-bean basis, and automatically wires all bean properties that have matching beans in the context (with the bean name matching the property name). Juergen -----Original Message----- From: spr...@li... [mailto:spr...@li...]On Behalf Of Marc Logemann Sent: Saturday, April 09, 2005 12:28 AM To: spr...@li... Subject: [Springframework-developer] verbosity of XML property declaration Hi, i ve followed with great interest the xml namespace discussion today and my concern is also in the area of xml verbosity. While looking at my context XML files (which allready reached 800 lines after 3 weeks of project programming), i saw that i have plenty of definitions which go like this: <bean...> <property name="logisticProviderManagerService"><ref bean="logisticProviderManagerService"/></property> </bean> If its not only me who prefers (whenever possible) to have the same attribute name than the bean name/id, it would be nice to have something like this: <bean...> <property name="logisticProviderManagerService" refbean="true"/> </bean> or <property name="logisticProviderManagerService" bean="ref|local"/> But i really dont know how many others do it this way. So i dont know if this is of common interest here. If its not of common interest, or if i feel that this is a must have, i assume that the package org.springframework.beans.factory.xml is my friend right? ;-) -- regards Marc Logemann http://www.logemann.org http://www.logentis.de ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ Springframework-developer mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-developer |
|
From: Juergen H. <ju...@in...> - 2005-04-08 22:44:31
|
On a related note: Since Spring 1.2 RC1, there are "ref" and "value" shortcut attributes on the <property> tag (and others): <property name="logisticProviderManagerService" ref="logisticProviderManagerService"/> Of course, this still explicitly mentions the name of the bean. As I said, autowire-by-name is probably what you're looking for then. Juergen -----Original Message----- From: spr...@li... [mailto:spr...@li...]On Behalf Of Juergen Hoeller Sent: Saturday, April 09, 2005 12:40 AM To: spr...@li... Subject: Re: [Springframework-developer] verbosity of XML property declaration Well, if it's about avoiding to express the "logisticProviderManagerService" name twice: why not use autowiring-by-name? This can be defined on a per-bean basis, and automatically wires all bean properties that have matching beans in the context (with the bean name matching the property name). Juergen -----Original Message----- From: spr...@li... [mailto:spr...@li...]On Behalf Of Marc Logemann Sent: Saturday, April 09, 2005 12:28 AM To: spr...@li... Subject: [Springframework-developer] verbosity of XML property declaration Hi, i ve followed with great interest the xml namespace discussion today and my concern is also in the area of xml verbosity. While looking at my context XML files (which allready reached 800 lines after 3 weeks of project programming), i saw that i have plenty of definitions which go like this: <bean...> <property name="logisticProviderManagerService"><ref bean="logisticProviderManagerService"/></property> </bean> If its not only me who prefers (whenever possible) to have the same attribute name than the bean name/id, it would be nice to have something like this: <bean...> <property name="logisticProviderManagerService" refbean="true"/> </bean> or <property name="logisticProviderManagerService" bean="ref|local"/> But i really dont know how many others do it this way. So i dont know if this is of common interest here. If its not of common interest, or if i feel that this is a must have, i assume that the package org.springframework.beans.factory.xml is my friend right? ;-) -- regards Marc Logemann http://www.logemann.org http://www.logentis.de ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ Springframework-developer mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-developer ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ Springframework-developer mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-developer |
|
From: Marc L. <ma...@lo...> - 2005-04-08 23:10:24
|
Hi, wasnt aware of that new feature of RC1, thats nice. Its the halfway of my proposal ;-) Of course you are right by saying that auto-wiring will help me here but call me conservative, i am not a big fan of it because of possible sideeffects and i want to have documented on bean basis what will be injected and what not. But the "ref" attribute in RC1 is a fair tradeoff between readability/flexibility and verbosity. I will go this route. thx for pointing out and boy, its hard to follow all that new features, which is good of course <g>. Juergen Hoeller wrote: > On a related note: Since Spring 1.2 RC1, there are "ref" and "value" > shortcut attributes on the <property> tag (and others): > > <property name="logisticProviderManagerService" > ref="logisticProviderManagerService"/> > > Of course, this still explicitly mentions the name of the bean. As I said, > autowire-by-name is probably what you're looking for then. > -- regards Marc Logemann http://www.logemann.org http://www.logentis.de |
|
From: Dmitriy K. <dko...@ru...> - 2005-04-08 23:43:01
|
> thx for pointing out and boy, its hard to follow all that new > features, which is good of course <g>. > Well, sometimes taking a look at the changelog when a new release ships could be useful: * added "value"/"ref" attributes to XML "property"/"constructor-arg" tag, as shortcut alternative to child elements * added "key" sub-element to XML "entry" tag for maps, allowing for inner beans, refs, values etc specified as key * added "key-ref" attribute to XML "entry" tag for maps, as shortcut alternative to a key element with "ref bean=" ... :-) Cheers, Dmitriy. |