|
From: JP P. <jp....@ti...> - 2003-05-30 13:07:42
|
Hi Isabelle, If a Map could be a Collection, make sure that it would be so in Java.=20 Elements in a collection are single: an Object. Elements in a Map are double: a key + an Object. The structure cannot be the same as a Map element always needs a key and = a collection never. I don't see a more generic solution as Rod's: One tag for every kind of Collection including arrays which are not = really collections but have the same structure. One tag for the maps. The difference will be the presence of a key attribute or sub-element in = map-entries which will not exist in collection-entries. In all cases, the XML will dictate between Maps and Collections by the = use of a key descriptor, even if we use the same envelopping tag.=20 We have not the choice. Regards, Jean-Pierre > -----Message d'origine----- > De : spr...@li...=20 > [mailto:spr...@li...] > De la part de Isabelle Muszynski > Envoy=C3=A9 : vendredi 30 mai 2003 13:55 > =C3=80 : Rod Johnson > Cc : spr...@li... > Objet : Re: RE : [Springframework-developer] DTD >=20 >=20 > Hi Rod, >=20 > I think it all depencs what the point is. If we want the xml=20 > to dictate the data structure used to represent the bean,=20 > then yes, we need a map, list, array etc tag. If the point is=20 > for the xml to indicate a collection, then a single=20 > collection tag should be sufficient. >=20 > Isabelle >=20 > On Fri, May 30, 2003 at 11:36:03AM +0100, Rod Johnson wrote: > > JP, > >=20 > > I like this. It's an improvement. We could even support=20 > object keys by=20 > > having a <key> subelement that supports a<value> or ref.=20 > But that's=20 > > in the future. > >=20 > > Isabelle wrote "I like the collections idea, but not the different=20 > > keywords for it (map, collection). All the user has to know is that=20 > > it's a collection, not how we implment it internally." (I=20 > don't think=20 > > you sent this to the list.) But aren't maps different to=20 > collections=20 > > or arrays (which we might also want to support eventually?)=20 > Two values=20 > > to manage, not just one? > >=20 > > I'm inclined to support Maps like this in 0.8. > >=20 > > Regards, > > Rod > >=20 > > ----- Original Message ----- > > From: "JP Pawlak" <jp....@ti...> > > To: <rod...@in...> > > Cc: <spr...@li...> > > Sent: Friday, May 30, 2003 11:05 AM > > Subject: RE : RE : [Springframework-developer] DTD > >=20 > >=20 > > Rod, > >=20 > > I'm inclined too to favor this. > > But I see another improvement without having now the right solution=20 > > about the map. In UrlHandlerMapping the data is in fact a bean=20 > > reference and this is not already checked. > > In methodNameResolver in contrast, it's a simple text (method name). > > Perhaps will we have an unique value/ref in the map entry=20 > body instead > > of simple text? > >=20 > > <property name=3D"mappings"> > > <map> > > <entry key=3D"/welcome.html"><ref=20 > bean=3D"pagedListController"/></entry> > > <entry key=3D"/detail.html"><ref=20 > bean=3D"pagedListController"/></entry> > > </map> > > </property> > >=20 > > <property name=3D"mappings"> > > <map> > > <entry key=3D"/welcome.html"><value>showMain</value></entry> > > <entry key=3D"/detail.html"><value>showDetail</value></entry> > > </map> > > </property> > >=20 > > Regards, > > Jean-Pierre > >=20 > >=20 > > > -----Message d'origine----- > > > De : rod...@in...=20 > > > [mailto:rod...@in...] > > > Envoy=C3=83=C2=A9 : vendredi 30 mai 2003 11:24 > > > =C3=83=E2=82=AC : JP Pawlak > > > Cc : 'Rod Johnson';=20 > spr...@li... > > > Objet : Re: RE : [Springframework-developer] DTD > > > > > > > > > JP, > > > > > > I agree, formalizing map support would be an improvement. I'm not=20 > > > sure we can do it for 0.8, though. Presently it's handled by a=20 > > > PropertyEditor. > > > > > > I wonder if it means we should introduce additional container=20 > > > elements <list> and <map> into our DTD? e.g.: > > > > > > <property name=3D"simple"><value>val</value></property> > > > <property name=3D"mappings"> > > > <map> > > > <entry key=3D"/welcome.html">pagedListController</entry> > > > <entry key=3D"/detail.html">pagedListController</entry> > > > </map> > > > </property> > > > > > > <property name=3D"coll"> > > > <collection> > > > <value>val</value> > > > <ref bean=3D"foo"/> > > > </collection> > > > </property> > > > > > > It's getting still more verbose, but it would be easier=20 > to parse and=20 > > > is more elegant. (Don't need to guess whether a value/ref=20 > is part of=20 > > > a collection.) > > > > > > I'm inclined to favour this. I could probably implement=20 > it by early=20 > > > next week (including maps). > > > > > > Regards, > > > Rod > > > > >=20 > >=20 > >=20 > >=20 > >=20 > >=20 > >=20 > > ------------------------------------------------------- > > This SF.net email is sponsored by: eBay > > Get office equipment for less on eBay!=20 > > http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5 > > _______________________________________________ > > Springframework-developer mailing list=20 > > Spr...@li... > >=20 > https://lists.sourceforge.net/lists/listinfo/s> = pringframework-developer > >=20 > >=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 >=20 >=20 > ------------------------------------------------------- > This SF.net email is sponsored by: eBay > Get office equipment for less on eBay!=20 > http://adfarm.mediaplex.com/ad/ck/711-11697-> 6916-5 >=20 > _______________________________________________ >=20 > Springframework-developer mailing list=20 > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer >=20 |