Loading ...
Sorry, an error occurred while loading the content.

Re: Your opinion? Collections representation

Expand Messages
  • Mark van der Kraan
    Hi Brendan, For maps, I would personally like a marker for the key-value pairs, eg:
    Message 1 of 2 , Mar 15, 2003
    View Source
    • 0 Attachment
      Hi Brendan,

      For maps, I would personally like a marker for the
      key-value pairs, eg:
      <map id='i43' class='java.util.Hashtable'>
      <entry>
      <string id='i44' value='1'/>
      <string id='i45' value='pear'/>
      </entry>
      <entry>
      <string id='i46' value='2'/>
      <string id='i47' value='orange'/>
      </entry>
      </map>
      This is a bit more verbose and doesn't really help much
      for manual editing (or maybe, perhaps less chance
      of accidently forgetting a key because visually you
      quickly see the pairs). But it is a lot easier to
      process with XSLT on the output side. But I now see
      that this format will be for input only, so this is
      not a strong argument ;-)
      Cheers,
      Mark


      --- In JSX-ideas@yahoogroups.com, "Brendan Macmillan"
      <Brendan.Macmillan@i...> wrote:
      > What do you think of this, for a simple representation of
      collections?
      >
      > <collection id='i43' class='java.util.ArrayList'>
      > <string id='i44' value='apple 0'/>
      > <string id='i45' value='orange 1'/>
      > <string id='i46' value='pear 2'/>
      > </collection>
      > <collection id='i47' class='java.util.LinkedList'>
      > <string id='i48' value='apple 3'/>
      > <string id='i49' value='orange 4'/>
      > <string id='i50' value='pear 5'/>
      > </collection>
      > <collection id='i51' class='java.util.Vector'>
      > <string id='i52' value='apple 6'/>
      > <string id='i53' value='orange 7'/>
      > <string id='i54' value='pear 8'/>
      > </collection>
      >
      > Note: the above examples are for types of Lists only... do you
      think we should
      > use the one tag name (ie "collection") for all kinds of collections
      (Lists,
      > Sets, and Maps) as in the above? [Note that the classname appears
      as well, so
      > it is fairly easy to tell which one it is.]
      >
      > Or do you think we should have a different tag name for each type
      (ie "list",
      > "set", "map")?
      > <list id='i51' class='java.util.Vector'>
      > <string id='i52' value='apple 6'/>
      > <string id='i53' value='orange 7'/>
      > <string id='i54' value='pear 8'/>
      > </list>
      >
      > The two factors I see are that:
      > Maps have pairs of values, so their length will always be an
      even number -
      > sets and lists can be any number.
      > The names "list" etc are shorter than "collection"
      >
      >
      > One final note: The idea of the above format is to make it easier
      to enter data
      > into XML manually.
      > JSX's usual verbose description of the collections includes lots of
      internal
      > information that you might not want to know about (although it is
      still required
      > for "correct" serialization). Thus, the plan is for JSX to *write*
      verbosely;
      > but to be able to *read* the new simple way (above), as well as the
      verbose
      > version.
      >
      >
      > Eagerly awaiting your opinion! :-D
      >
      > Cheers,
      > Brendan Macmillan
      > --
      > bren@m... tel: +61 3 9905 1502 project: www.jsx2.com
    Your message has been successfully submitted and would be delivered to recipients shortly.