Hi,

Jonathan Cook schrieb:
> Felix,
> 
> Pardon me playing devil's advocate a little here, especially since I
> suggested a post-processing step that relies on the "feature" you
> mention ;)
> 
> Real world implementations always trump the spec!  It talks like a duck!
> 
> Your statement seems to show that the ordering information is
> intentionally and willfully discarded in the JSON render, because the
> render is not implemented in an orderable way.  Is that the intention or
> is the JSON render duck-ordering just as much as the JS guys?

Wrong. The JSON render renders the child nodes in exactly the order as
returned from the repository. The properties of nodes (or resources) are
of course not returned in any defined order simply because the JCR spec
does not define an order amongst the properties ...

The JSON render does not create an intermediate JSONObject but directly
writes the data out thus keeping the order.

Regards
Felix

> 
> I'm trying to argue against introducing any meta properties, but if the
> order is intentionally discarded, and that information is valuable
> (which I think we can agree on) then there definitely should be a way to
> obtain that information.  A meta property is certainly the simplest way
> to do that.
> 
> Regards,
> Jonathan 'J5' Cook
> 
> Felix Meschberger wrote:
>> Hi,
>>
>> Edelson, Justin schrieb:
>>  
>>> ... If a JSON implementation implements objects in a
>>> non-orderable way (which is permitted under the spec and
>>> done in the json.org Java implementation), you can never
>>> recover the original order of child nodes.
>>>     
>>
>> The spec is actually very clear: The order amongst properties in objects
>> is explicitly undefined. That is, code must never expect properties to
>> have a specific order.
>>
>> The problem is that browser JavaScript interpreters are implemented
>> providing a property order, namely the order of property definition
>> (similar to the ordering of the LinkedHashMap in Java) and client-side
>> java scripters unfortunately tend to depend on this "feature".
>>
>> Regards
>> Felix
>>
>>   
> 
> 

Reply via email to