[Pharo-users] Having STON generate flatter output

Esteban A. Maringolo emaringolo at gmail.com
Thu May 26 15:05:08 EDT 2016


That is more a serialization strategy issue, that happens a lot with JSON
serialization as well.

As far as I could see there is no such feature to perform substitutions
neither at read/write time in STON or NeoJSON, for that you would need to
traverse the whole object graph first, or have some metadata about what is
is going to be fully serialized and what it is going to be a reference,
like Fuel does.

Regards!










Esteban A. Maringolo

2016-05-26 15:52 GMT-03:00 Peter Uhnák <i.uhnak at gmail.com>:

> Hi,
>
> is it possible to configure STON to generate more flat output?
>
> Imagine a scenario where an element can have children and the children
> have reference to their parent
>
>
>> Now the problem is that the output of STON will depend on the order of the
> items,
> so if I have "nice" ordering for the following, I will get a flat output
>
>
>> If however the ordering is different, the output will be more nested
>
>
>> As the ordering is not stable, I often end up with results like this
> (zoomed out)
>
>
>> The image above has depth of about fourteen, even though it could be
> represented with just depth of four.
>
> In the current state I cannot actually look at the generated output
> because it's impossible to find anything, which is problematic when an
> error occurs.
>
> So the question is if it is possible to push the actual objects as far up
> as possible, and use references "@12" only on the deeper levels.
>
> Thanks,
> Peter
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pharo.org/pipermail/pharo-users_lists.pharo.org/attachments/20160526/e1a155d7/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: flat.png
Type: image/png
Size: 157138 bytes
Desc: not available
URL: <http://lists.pharo.org/pipermail/pharo-users_lists.pharo.org/attachments/20160526/e1a155d7/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nested.png
Type: image/png
Size: 68811 bytes
Desc: not available
URL: <http://lists.pharo.org/pipermail/pharo-users_lists.pharo.org/attachments/20160526/e1a155d7/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: scenario.png
Type: image/png
Size: 10823 bytes
Desc: not available
URL: <http://lists.pharo.org/pipermail/pharo-users_lists.pharo.org/attachments/20160526/e1a155d7/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not-flat.png
Type: image/png
Size: 156948 bytes
Desc: not available
URL: <http://lists.pharo.org/pipermail/pharo-users_lists.pharo.org/attachments/20160526/e1a155d7/attachment-0003.png>


More information about the Pharo-users mailing list