|
From: =?iso-8859-1?Q?<jp....@ti...> - 2003-05-28 15:18:57
|
Hi Rod,=0D=0A=0D=0AAs the proposal is consistent and real needs are invok= ed, I have no more objection.=0D=0A=0D=0ARegards,=0D=0AJean-Pierre=0D=0A=0D= =0A---------- Initial Header -----------=0D=0A=0D=0AFrom : springfra= mew...@li...=0D=0ATo : "jp.pawla= k...@ti..." <jp....@ti...>=0D=0ACc : "rod.johnson" <ro= d.j...@in...>, isabelle <isa...@me...>, = "rod.johnson" <rod...@in...>, springframework-dev= eloper <spr...@li...>=0D=0ADate := Wed, 28 May 2003 07:25:25 -0400=0D=0ASubject : Re: Re: [Springframework= -developer] Spring bean factory XML format=0D=0A=0D=0AJP suggested:=0D=0A= =0D=0A<bean class=3D"MyClass" id=3D"foos" singleton=3D"false> =0D=0A<prop= erty name=3D"foo">FOO</property> =0D=0A<property name=3D"foo2" value=3D"F= OO2"/> =0D=0A<property name=3D"foo3" refid=3D"foo3"/> =0D=0A<property nam= e=3D"foo4"> =0D=0A <data>FOO4.1</data> =0D=0A <data value=3D"FOO4.2"/= > =0D=0A <data refid=3D"foo4.3"/> =0D=0A</property> =0D=0A</bean> =0D=0A= =0D=0A=0D=0AThe problem I see here is that there are 3 ways of defining =0D= =0Aliterals:=0D=0A- in the body of the property element (as before)=0D=0A= - in a value attribute. I don't think this is a good idea, as =0D=0Aattri= butes can only hold simple strings without getting into =0D=0Anasty escap= ing.=0D=0A- in a <data> element, which is necessary anyway for a =0D=0Aco= llection.=0D=0A=0D=0AJuergen makes a good point about mixed collections o= f =0D=0Areferences and string data (which of course would be =0D=0Aconver= ted to objects). Initially I thought this was unlikely, =0D=0Abut I reali= sed it has quite a few uses (with the AOP proxy =0D=0Afactory, for exampl= e), and the <value> subelement I suggested =0D=0Ahandles it. (It's alread= y implemented: see collections.xml in =0D=0Abeanfactory.xml tests.)=0D=0A= =0D=0AThe most consistent approach IMHO is:=0D=0A=0D=0A<bean class=3D"MyC= lass" id=3D"foos" singleton=3D"false> =0D=0A<property name=3D"foo"><value= >FOO</value></property> =0D=0A=0D=0A<property name=3D"foo3">=0D=0A <ref = refid=3D"foo3"/> =0D=0A</property>=0D=0A<property name=3D"foo4"> =0D=0A = <value>FOO4.1</value> =0D=0A <value>FOO4.2</value>=0D=0A <ref refid=3D= "foo4.3"/> =0D=0A</property> =0D=0A</bean> =0D=0A=0D=0AAlways consistent:= always at least one value or ref =0D=0Asubelement of a property elt; <va= lue> contains only text =0D=0Adata; ref body must be empty.=0D=0A=0D=0ASl= ightly more verbose, but probably easier to author with an =0D=0AXML edit= or (even the basic Eclipse XML editor I use most of =0D=0Athe time).=0D=0A= =0D=0AI don't care whether it's called value or data, or anything =0D=0Ae= lse...any ideas?=0D=0A=0D=0ARegards,=0D=0ARod=0D=0A=0D=0A=0D=0A----------= ---------------------------------------------=0D=0AThis SF.net email is s= ponsored by: ObjectStore.=0D=0AIf flattening out C++ or Java code to make= your application fit in a=0D=0Arelational database is painful, don't do = it! Check out ObjectStore.=0D=0ANow part of Progress Software. http://www= .objectstore.net/sourceforge=0D=0A_______________________________________= ________=0D=0ASpringframework-developer mailing list=0D=0ASpringframework= -dev...@li...=0D=0Ahttps://lists.sourceforge.net/lists= /listinfo/springframework-developer=0D=0A=0A=0A********** SPECIAL ADSL **= ********=0AL'ADSL =E0 partir de 15,95 EUR/mois et le modem ADSL offert ? = C'est en exclusivit=E9 chez Tiscali !=0APour profiter de cette offre, cl= iquez ici: http://register.tiscali.fr/adsl/=0AOffre soumise =E0 condition= s.=0A |