Request for review - std.serialization (orange)

Jacob Carlborg doob at me.com
Tue Apr 2 11:50:03 PDT 2013


On 2013-04-02 18:24, Matt Soucy wrote:

> Again, my misunderstanding. I assumed you were talking about taking a
> pre-existing struct, not one generated from the .proto

It doesn't really matter where the struct comes from.

> You could easily receive 3,1,2 or 2,1,3 or any other such combination,
> and it would still be valid. That doesn't stop you from doing what you
> suggest, however, as long as you can lookup id[name] and name[id].

Right. The archive gets the names, it's then up to the archive how to 
map names to PB ids. If the archive gets "foo", "bar" and the serialized 
data contains "bar", "foo" can it handle that? What I mean is that the 
serializer decides which field should be (de)serialized not the archive.

> Eh. I personally think that it makes sense, and don't have much of a
> problem with it.

It probably makes sense if one sends the data over the network and the 
data is mostly value based. I usually have an object hierarchy with many 
reference types and objects passed around.

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list