|
From: Kopylenko, D. <dko...@ac...> - 2003-10-20 17:02:34
|
+1 for 'local' -----Original Message----- From: j=C3=BCrgen h=C3=B6ller [werk3AT] = [mailto:jue...@we...]=20 Sent: Monday, October 20, 2003 11:51 AM To: spr...@li... Subject: RE: [Springframework-developer] XML bean references Colin, Hmmm, you've got a point there. I also like "local" more; I just = considered "internal" as the opposite for "external". You're right that "external" = will probably not get used anymore; the only important different is = referencing a strictly local bean versus any bean. I'm inclined to go the "bean" / "local" / "external"(deprecated) route again... Votes please! Given this decision, I vote for "local" instead = of "internal"; Colin obviously does too. Juergen -----Original Message----- From: Colin Sampaleanu [mailto:col...@ex...] Sent: Monday, October 20, 2003 4:50 PM To: spr...@li... Subject: Re: [Springframework-developer] XML bean references I'm ok with this, although it's getting more verbose. I also wonder if=20 "external" would ever be used in the future at all? That is, would=20 somebody ever be interested in validating that something is only=20 external? Perhaps people would indeed use it due to the principal of=20 least surprise (that is, if you use only 'internal' and 'external', = then=20 you always know exactly where your beans are coming from. But then why=20 use the 'ambiguous 'bean' at all?). If you assume people would probably _not_ use 'external', then I think=20 your original 'local' is nicer name for bean id references that are=20 local to the file only. i.e.: - <ref bean=3D"..."/> can reference any bean by any name (equal to = current "external", similar to current "bean" but without XML idref check); - <ref local=3D"..."/> can reference a bean id in the same XML file = (equal to the current "bean"> - <ref external=3D"..."/> deprecated, not enocuraged to be used, and documented minimally. If you _do_ think people would actually have a need for and use = "external" on an ongoing basis, then probably "internal" as the opposite does make = more sense than "local"... Regards, Colin j=C3=BCrgen h=C3=B6ller [werk3AT] wrote: >Third and hopefully final attempt at proper attribute naming, with=20 >"internal" instead of "local" (as it matches its counterpart = "external" better): > >- <ref bean=3D"..."/> can reference any bean by any name (equal to=20 >current "external", similar to current "bean" but without XML idref = check); >=20 >- <ref external=3D"..."/> stays as it is for the time being, but in = its=20 >final incarnation, it should check that the reference is really = outside the current XML file; >=20 >- <ref internal=3D"..."/> can reference a bean id in the same XML file = >(equal to the formerly proposed "bean-id", with an XML idref check). > >Request for comments again :-) > >Juergen > > >-----Original Message----- >From: Colin Sampaleanu [mailto:col...@ex...] >Sent: Monday, October 20, 2003 12:53 AM >To: j=C3=BCrgen h=C3=B6ller [werk3AT] >Cc: spr...@li... >Subject: Re: [Springframework-developer] XML bean references > > >I think this would work, and is probably the least ambiguous. > >j=C3=BCrgen h=C3=B6ller [werk3AT] wrote: > > =20 > >>Colin, Rod, >> >>You're right regarding the term "external" for a different XML file,=20 >>not only a different context. On second thought, I consider "bean-id" = >>unclear too, as beans in other XML files also have an "id". Thus, a=20 >>slightly refined suggestion: >> >>- <ref bean=3D"..."/> can reference any bean by any name (equal to=20 >>current "external", similar to current "bean" but without XML idref=20 >>check); >> >>- <ref external=3D"..."/> stays as it is for the time being, but in = its=20 >>final incarnation, it should check that the reference is really=20 >>outside the current XML file; >> >>- <ref local=3D"..."/> can reference a bean id in the same XML file=20 >>(equal to the formerly proposed "bean-id", with an XML idref check). >> >>That's probably as easy to explain as possible: "bean" is the general = >>one that can reference anything, "external" is for beans outside the=20 >>current file, "local" for beans inside the current file -- and it's=20 >>still backward-compatible. What do you think? >> >>Juergen >> >> >> >> -----Urspr=C3=BCngliche Nachricht-----=20 >> Von: Colin Sampaleanu [mailto:col...@ex...]=20 >> Gesendet: So 19.10.2003 16:20=20 >> An: j=C3=BCrgen h=C3=B6ller [werk3AT]=20 >> Cc: spr...@li...=20 >> Betreff: Re: [Springframework-developer] XML bean references >>=09 >>=09 >> >> j=C3=BCrgen h=C3=B6ller [werk3AT] wrote: >>=09 >> >Everybody, >> > >> >On the occasion of allowing a single application context to be loaded from multiple XML files, I've reconsidered a detail of our XML syntax: The "ref" tag currently has two different attributes: >> >- "bean" to reference a bean in the same application context via its id attribute (the XML id); >> >- "external" to reference a bean in a parent context. >> >The latter can basically address any bean, be it in the same context or a parent, an id or an alias name. >> > >> >The main rationale behind the "bean"/"external" separation was simply separating between XML validation of id refs (by the XML parser) = and referencing any kind of name (validated by the bean factory). The = latter was mainly necessary for referencing beans outside of the current XML file, = at that time a parent context. In the mean time, a single context can be defined by multiple XML files; thus I don't consider the = "bean"/"external" naming appropriate anymore. >> > >> >Instead, let me suggest different attribute names: >> >- keep a "bean" attribute to reference *any* kind of name, be it id or alias, just like the current "external" attribute; >> >- introduce a new "bean-id" attribute to reference a bean in the same XML file via its XML id, like the current "bean" attribute. >> > >> >If we keep the "external" attribute for the moment as an equivalent of the proposed "bean" attribute, this would be fully compatible with existing bean definition files. Of course, "bean" attributes would not = get validated by the XML parser anymore, but that would not break the files = in any way. "external" attributes would still work too, the same as = before. >> > >> >We should recommend migrating to the new pattern though, i.e.: >> >- rename "bean" to "bean-id"; >> >- rename "external" to "bean". >> >That should be easy to do; and as the old pattern still works, there is no need to migrate existing bean definition files immediately. >> > >> >I've thought about this for a while, and I consider it very important to clarify the attributes in a way like the above. Else, it = will be pretty hard to explain the rationale behind "bean" and "external", especially when using multiple XML files for a single context. "bean" = and "bean-id" are far easier to explain: "bean" always works, "bean-id" = adds validation by the XML parser if specifying a bean id in the same = context. >> > >> >Any thoughts on this, any strong objections? I would actually like to get this into M2, although it's pretty close already. As the change = is trivial to implement and fully backward compatible, that shouldn't = matter too much. >> >=20 >> > >> Even the current 'external' can be considered to still make sense if you >> ust consider it to mean the bean you are refering to is 'external' to >> the current xml file, as opposed to the current definition, that is it >> external to the current context. >>=09 >> However, I do agree that it's probably cleaner and makes more sense to >> just go with 'bean' and 'bean-id', and emphasize that the latter should >> be used if possible for extra validation... That point should definitely >> be documented properly (and used in the examples), so people don't >> accidentally throw away this free validation by using just 'bean'. >>=09 >> ------------------------------------------------------- This SF.net email sponsored by: Enterprise Linux Forum Conference & = Expo The Event For Linux Datacenter Solutions & Strategies in The Enterprise=20 Linux in the Boardroom; in the Front Office; & in the Server Room=20 http://www.enterpriselinuxforum.com _______________________________________________ Springframework-developer mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-developer N=18HY=DE=B5=E9=9A=8A[){([oIzk=E1=AC=8A=C7=8B{=16*'}e=DE=9D=C7=84=C6=9A=13= /z{E=E8=A2=B2=C5=BECj=D6=9Cz{^*%=D8=A8=C4=AD^'txInzk=C7=8B{{ax=1A=1A=1Ah= =179mqe=17z=DE=AD=1A(=1Bm =CA=A7 +=1E)=0E+g(*kx=1F=E1=B6=AD=C5=A0ut=DE=96^f)+-J=E1=A1=9A = ojg=1Dz=E5=A2=97+-.=E1=A6=AD=C7=9F=1Ea=E1=A1=B6lb,=E1=AC=A2 y+=E1=A1=81=DE=B7b=E0=A0=B2?+-w=08k=E1=A9=8Ax=1F=C5=A0ui=DE=96^ |