|
From: Rod J. <rod...@in...> - 2004-01-17 09:40:58
|
Colin I think the first way would be preferable at this late stage. It's backward compatible anyway--previous definitions will still work--so I'm happy for you to do it. We can always improve the implementation in future. I'm happy with beanid/bean for naming. Regards, Rod ----- Original Message ----- From: "Colin Sampaleanu" <col...@ex...> To: <spr...@li...> Sent: Saturday, January 17, 2004 4:45 AM Subject: Re: [Springframework-developer] xml dtd addition for bean id reference > I took a bit of a look at this. It would be completely trivial to > support at a basic level, where the element would be converted at parse > time into a string, essentially exactly resolving to exactly the same as > <value>xx/<value>. This would allow validation of local beans via the > xml parser's idref mechanism, but would not allow Spring (or anybody > else using the parser) to validate external bean ids, since the info > would be lost. > > The better option would be to treat it in a way similar to the same way > <ref> is treated right now, via a special placeholder similar to ref's > RuntimeBeanReference. This touches a lot more code though. > > Unless there is opposition I would like to add at least the basic level > mentioned in the first paragraph. I think it's a piece of low-hanging > fruit that will save some people from typos a bit earlier in the > build/deploy/test cycle... > > > > Colin Sampaleanu wrote: > > > Actually, now that I think about it, it's not just about validation. > > If you are in an IDE plugin, the new element would allow the plugin to > > offer code completion on the id name... Otherwise (with the present > > setup), it would have to know something about the actual object using > > those properties, to know they are in fact bean ids... > > > > > > Rod Johnson wrote: > > > >> Mmm, I'd need to think about that. I guess the validation potential > >> would be > >> good. Thoughts? > >> > >> Btw the switch from interceptors to interceptorNames was necessary as > >> the > >> old way was conceptually wrong. It couldn't handle common > >> interceptors or > >> advisors that were prototypes. This is important to support mixin usage, > >> which should now always work correctly. > >> > >> Rod > >> > >> ----- Original Message ----- > >> From: "Colin Sampaleanu" <col...@ex...> > >> To: <spr...@li...> > >> Sent: Wednesday, January 14, 2004 5:32 PM > >> Subject: [Springframework-developer] xml dtd addition for bean id > >> reference > >> > >> > >> > >> > >>> The recent switch in AbstractAutoProxyCreate which forced me to switch > >>> some BeanNameAutoProxyCreator configs from something like > >>> ... > >>> <property name="interceptorNames"> > >>> <list> > >>> <ref bean="hibInterceptor"/> > >>> <ref bean="matchAllTxInterceptor</ref> > >>> </list> > >>> </property> > >>> ... > >>> > >>> to > >>> ... > >>> <property name="interceptorNames"> > >>> <list> > >>> <value>hibInterceptor</value> > >>> <value>matchAllTxInterceptor</value> > >>> </list> > >>> </property> > >>> ... > >>> > >>> got me thinking that the former did have the advantage of being much > >>> easier to validate without getting the actual user of the properties > >>> (the postprocessor in this case) involved. That is, in the case of a > >>> <ref local="xxx" /> > >>> the xml processor can do it, while > >>> <ref bean="xxx" /> > >>> can be validate by the loader or something like an Eclipse plugin. But > >>> > >>> <property name="interceptorNames"> > >>> <list> > >>> <value>something</value> > >>> </list> > >>> </property> > >>> > >>> can only be validate by the user of that property. So how about we add > >>> another element which is used to produce a text value which is a bean > >>> id. That is: > >>> <property name="interceptorNames"> > >>> <list> > >>> <beanid bean="a-local-or-external-bean"/> > >>> <beanid local="a-local-bean"/> > >>> </list> > >>> </property> > >>> > >>> The latter beanid element would be checked by the xml processor. The > >>> former would be checkable only by the loader or by something like an > >>> IDE > >>> plugin. > >>> > >>> What does everybody think? > >>> > >>> Regards, > >>> Colin > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> ------------------------------------------------------- > >>> This SF.net email is sponsored by: Perforce Software. > >>> Perforce is the Fast Software Configuration Management System offering > >>> advanced branching capabilities and atomic changes on 50+ platforms. > >>> Free Eval! http://www.perforce.com/perforce/loadprog.html > >>> _______________________________________________ > >>> Springframework-developer mailing list > >>> Spr...@li... > >>> https://lists.sourceforge.net/lists/listinfo/springframework-developer > >>> > >> > > > > > > ------------------------------------------------------- > The SF.Net email is sponsored by EclipseCon 2004 > Premiere Conference on Open Tools Development and Integration > See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. > http://www.eclipsecon.org/osdn > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer |