|
From: <jue...@we...> - 2003-05-28 10:40:06
|
What about mixing references and values in a collection? Would it look = as follows: <bean id=3D"foo"> <property name=3D"moo">moo</property> <property name=3D"coll"> <element refid=3D"alpha"/> <element refid=3D"beta"/> <element>gamma</element> </property> </bean> Rod's proposed syntax would be like this: <bean id=3D"foo"> <property name=3D"moo">moo</property> <property name=3D"coll"> <ref refid=3D"alpha"/> <ref refid=3D"beta"/> <value>gamma</value> </property> </bean> I tend to prefer the latter, as it clearly separates references and = values. Juergen -----Original Message----- From: Isabelle Muszynski [mailto:isa...@me...] Sent: Wednesday, May 28, 2003 12:33 PM To: rod...@in... Cc: spr...@li... Subject: Re: [Springframework-developer] Spring bean factory XML format HI Rod, Do it the way JP suggested : <bean id=3D"foo"> <property name=3D"moo">moo</property> <property name=3D"coll"> <element refid=3D"alpha"> <element refid=3D"beta> </property> </bean> Isabelle On Wed, May 28, 2003 at 06:17:54AM -0400, rod...@in... = wrote: > Isabelle,=20 >=20 > OK, we can change name -> id when defining all beans, and use=20 > refid for references. >=20 > The only problem I see with your syntax below... >=20 > <property name=3D"thefoo" refid=3D"foo/> > <property name=3D"moo">moo</property> >=20 > ...is that I can't see how it would support collections. I=20 > see this as a major enhancement, possible with the original=20 > proposal, that had <value> and <ref> subelements. >=20 > I can easily change the XML parsing for whatever we agree.=20 >=20 > Regards, > Rod >=20 > > Hi Rod, > >=20 > > There is one thing I do not like about your proposed=20 > syntax: you use <ref > > name=3D"xxx"> is used in two different contexts, one when you=20 > define a bean > > that can serve as a reference, and once when you refer to=20 > such a bean from > > another bean. > > That's confusing. It would be better to define with for ex.=20 > an id attribute, > > and reference with a refid attribute: > >=20 > > <bean name=3D"foo" id=3D"foo"/> > > <bean name=3D"bar" id=3D"bar"> > > <property name=3D"thefoo" refid=3D"foo/> > > <property name=3D"moo">moo</property> > > </bean> > > <bean name=3Dbaz> > > <property name=3D"bla">blabla</property> > > </bean> > >=20 > > Note that bean bar can in turn be referenced from other=20 > beans, thanks to its > > id attribute. Bean baz cannot be referenced, because it=20 > doesn't have an id > > attribute. > >=20 > > A validating parser will not help you make sure that bean=20 > foo really exists > > when referenced, and neither will a DTD. > >=20 > > Isabelle >=20 >=20 > ------------------------------------------------------- > This SF.net email is sponsored by: ObjectStore. > If flattening out C++ or Java code to make your application fit in a > relational database is painful, don't do it! Check out ObjectStore. > Now part of Progress Software. http://www.objectstore.net/sourceforge > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer >=20 >=20 --=20 Isabelle Muszynski Software Engineer Zandweellaan 4 2660 Antwerpen Belgium Tel. 32-(0)3-830 18 54 Mobile: 32-(0)485 49 50 89 Email: isa...@me... Website: www.meta-logix.com ------------------------------------------------------- This SF.net email is sponsored by: ObjectStore. If flattening out C++ or Java code to make your application fit in a relational database is painful, don't do it! Check out ObjectStore. Now part of Progress Software. http://www.objectstore.net/sourceforge _______________________________________________ Springframework-developer mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-developer |