On 11.04.11 05:50, "Felix Meschberger" <[email protected]> wrote:
>Am Freitag, den 08.04.2011, 12:04 +0100 schrieb Alexander Klimetschek:
>> On 08.04.11 08:01, "Carsten Ziegeler" <[email protected]> wrote:
>> >maps rarely have an order regardless of the language.
>> 
>> A linked map is not an unusual data structure. As Tobi noted, WCM/CMS
>>is a
>> prominent use case.
>
>Yes, but: the Map interface itself has no defined order: "Some map
>implementations, like the TreeMap class, make specific guarantees as to
>their order; others, like the HashMap class, do not."
>
>So, if you encounter a "Map" (not a TreeMap or LinkedHashMap), you must
>not depend on any key ordering ...
>
>And most Map implementations used are in fact neither TreeMap nor
>LinkedHashMap.

Yes, I agree. However,this is "just" the way the abstractions in the Java
Collections API have been designed. With "unusual data structure" I was
actually meaning use-cases rather than specific data structure concepts in
languages such as Java. For a protocol-level data structure you want to be
language-independent, and focus on what is needed.

Not sure if I wrote that already: it is really unfortunate that the order
is excluded from JSON (which only comes from the ECMAscript definition)
when the serialization format already keeps the ordering so easily.

Regards,
Alex

-- 
Alexander Klimetschek
Developer // Adobe (Day) // Berlin - Basel




Reply via email to