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

TJ Corona tj.corona at kitware.com
Thu Dec 21 15:40:59 EST 2017


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. 

> 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
> Clifton Park, NY 12065-8662
> Phone: 518-881-4421 <tel:(518)%20881-4421>
> _______________________________________________
> Smtk-developers mailing list
> Smtk-developers at smtk.org
> https://smtk.org/mailman/listinfo/smtk-developers

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://smtk.org/pipermail/smtk-developers/attachments/20171221/8cb9bb2a/attachment.html>


More information about the Smtk-developers mailing list