polygene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Merlin <p...@nosphere.org>
Subject Re: ValueDeserialization help requested
Date Mon, 13 Jul 2015 10:45:10 GMT
Paul Merlin a écrit :
> Hey Niclas,
>
> Yep, serialization is pretty straight forward.
> Deserialization is a bit more convoluted.
>
> That is to support streamed (de)serialization of large datasets like
> giant Entities/Values or large collections of these.
>
> Serialization is always streaming.
> Deserialization is streaming by default (pull parsing) but may switch to
> plain tree parsing when needed (eg. _type). This is what makes the
> deserialization a bit complex.

Some more information.

ValueDeserializerAdapter has two parameterized types:
- the pull-parsing handler
- the tree parsing node type

Pull-parsing to tree-parsing switch occurs in readObjectTree(..) method.


Niclas Hedhman a écrit :
> Although I quite easily managed to add the feature of "object notation" (vs
> the key/value notation) to map serialization, the deserialization case is
> much harder to understand, and I am at loss where this decision and code
> really occurs.

For pull-parsing this should be in:
- ValueDeserializerAdapter::deserializeMap(..)

For tree-parsing this should be in:
- ValueDeserializerAdapter::deserializeNodeEntryMap(..)
- ValueDeserializerAdapter::deserializeNodeObjectMap(..)

So, if you are speaking of MapType.Variant handling, it looks like it's
actually handled only in the tree-parsing case, not in the pull-parsing
case.

Don't hesitate to ask me for more.

Cheers

/Paul


Mime
View raw message