Haxe Unserializer -- proposed mechanism for handling serialzation compatibility issues

72 views
Skip to first unread message

Jeff Ward

unread,
Aug 10, 2017, 12:25:43 PM8/10/17
to Haxe
Hi Haxe folks,

I've submitted a PR for a mechanism and API (TypeInstantiator, mimicking the TypeResolver pattern that already exists there) in the Haxe standard library's Unserializer to handle issues of serialization backward compatibility.

I'd appreciate your thoughts / feedback if you have:
  • Worked with serialization compatibility issues across a changing codebase
  • Experience designing nice Haxe API's
  • Iterated over key/value pairs in Haxe (see this comment, currently proposing the latter)
  • Just like giving your opinion. :D
The feature / motivation / example / possible alternatives are all described in the github issue. Please comment there (or here if you don't have a github account.)

Best,
-Jeff

Jeff Ward

unread,
Aug 14, 2017, 10:24:13 AM8/14/17
to Haxe
Bump. Not much interest in serialization 'round here?

Ashiq A.

unread,
Aug 14, 2017, 10:59:26 AM8/14/17
to haxe...@googlegroups.com
Hi Jeff,

I don't know anything about (nor use) Haxe's Unserializer, and I skimmed through your PR just now.

One thing I can suggest: are there any unit tests for Unserializer? Is it possible to add some? I don't know if you can write a test for your specific scenario (class schema changes and deserializing still works) without jumping through some hoops (eg. hard-coding the serialized data and deserializing to an updated version of the class).  Is that something worth investigating?

--Ashiq


On Mon, Aug 14, 2017 at 10:24 AM, Jeff Ward <jeff...@gmail.com> wrote:
Bump. Not much interest in serialization 'round here?

--
To post to this group haxe...@googlegroups.com
http://groups.google.com/group/haxelang?hl=en
---
You received this message because you are subscribed to the Google Groups "Haxe" group.
For more options, visit https://groups.google.com/d/optout.

Jeff Ward

unread,
Aug 14, 2017, 11:23:45 AM8/14/17
to Haxe
Hi Ashiq,

Thanks for the note -- indeed, I should format my example as a unit test. And yes, to exercise this feature, you'd typically just want just a static "old serialization" string to deserialize successfully. It seems like TypeResolver also isn't covered in the ser unit test, maybe I'll update my PR with some tests and kill two birds with one stone. :)

Best,
-Jeff

Jeff Ward

unread,
Aug 14, 2017, 1:02:44 PM8/14/17
to Haxe
Ok, PR submitted with testcases for TypeResolver and TypeInstantiator: https://github.com/HaxeFoundation/haxe/pull/6514

Cheer,
-Jeff
Reply all
Reply to author
Forward
0 new messages