|
From: Colin S. <col...@ex...> - 2004-06-17 19:44:13
|
Sorry, I meant to reply and completely forgot about it. I think this is a decent idea, and have been unable to think of any nagative possibilities arising out of it... Colin jürgen höller [werk3AT] wrote: >Any opinions on this? I've already prototypically implemented it, and all tests pass. Just waiting whether there are any objections, or different naming proposals :-) > >Juergen > > >________________________________ > >Von: spr...@li... im Auftrag von jürgen höller [werk3AT] >Gesendet: Di 15.06.2004 23:41 >An: spr...@li... >Betreff: [Springframework-developer] Explicit reference to bean in parent context > > > >There is an interesting feature request in our JIRA: > >http://opensource.atlassian.com/projects/spring/browse/SPR-166 > >Basically, a bean should be able to reference a bean of the same name in the parent context, for example to proxy it. > >Currently, a reference to the same bean name will lead to a self reference. I'm not keen on changing this, as there might be valid use cases for such a configuration. > >I quite like Damon's suggestion: introduce a "parent" attribute for the <ref> tag, as alternative to "bean" and "local". Such a reference explicity refers to a bean in the parent context rather than in the current one. > >I've already implemented this: was straightforward to do, with RuntimeBeanReference having an optional "toParent" flag now. > >As this is fully backward-compatible and a nice (though probably rarely used) enhancement, I don't mind including this in 1.0.3. Opinions? > >Juergen > > |