[Smtk-developers] Propose to change the serialization logic of numberOfValues/Items in attribute system

Haocheng Liu haocheng.liu at kitware.com
Thu Dec 21 16:01:59 EST 2017


On Thu, Dec 21, 2017 at 3:40 PM, TJ Corona <tj.corona at kitware.com> wrote:

> If “NumberOfValues” is simply reading the length of a vector that the json
> stream is going to populate anyway, I would omit it from the serialization.
> If NumberOfValues is pointing to a unique field in a class, though, I would
> keep it in. I think we only need the minimal set of info to reproduce a
> class’s state.
>
> It's the first case. I would put an issue in SMTK so that we would revisit
it when I have time.

> On Dec 21, 2017, at 3:34 PM, Haocheng Liu <haocheng.liu at kitware.com>
> wrote:
>
> Hi,
>
> In the past when we serialize items between client and server,
>
>  we serialize "NumberOfValues" info  and we also serialize data for each
> item as(Ex. componentItem)
>
> [ { "Val": { "Resource": "uuid-1", "Component": "uuid-2" } },{"UnsetVal": True} ... ]
>
> which is pretty verbose as David has pointed out.
>
> Actually since we serialize the values in the ComponentItem as a array,
> the array size would be naturally equal to the NumberOfValues. There is no
> need to repeat this info.
>
> Meanwhile, it would be better to serialize the data as:
>
> [ [ "uuid-1", "uuid-2"], ... ]
>
> which is cleaner and easier.
>
> Ideas?
> --
> Best regards
> Haocheng
>
> Haocheng LIU
> Kitware, Inc.
> R&D Engineer
> 21 Corporate Drive
> <https://maps.google.com/?q=21+Corporate+Drive+Clifton+Park,+NY+12065&entry=gmail&source=g>
> Clifton Park, NY 12065
> <https://maps.google.com/?q=21+Corporate+Drive+Clifton+Park,+NY+12065&entry=gmail&source=g>
> -8662
> Phone: 518-881-4421 <(518)%20881-4421>
> _______________________________________________
> Smtk-developers mailing list
> Smtk-developers at smtk.org
> https://smtk.org/mailman/listinfo/smtk-developers
>
>
>


-- 
Best regards
Haocheng

Haocheng LIU
Kitware, Inc.
R&D Engineer
21 Corporate Drive
Clifton Park, NY 12065-8662
Phone: 518-881-4421 <(518)%20881-4421>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://smtk.org/pipermail/smtk-developers/attachments/20171221/3ac3112d/attachment-0001.html>


More information about the Smtk-developers mailing list