Monday, May 23, 2016

serialization layer

[moss][9hrs] Wow, the day just flew by. I'm enjoying the pleasant illusion of rapid progress. I wrote a whole great steaming mess of code, anyway.

notes from today's CL.

1) BinTag helper methods to facilitate making a BinTag directly from a Type
2) Added Primitive flag to BinTag to make error-cases better.
3) ContainerSerializers. Add support for:
   a. Stack (requires custom writer that reverses order)
   b. Arrays
   c. Nested containers (required whole new methods for recursively writing all the
      BinTags necessary to fully specify a type and then read them back.
4) Primitive/Container Serializers initialization flow entrusted to TypeMap.
   This feels better.
5) Removed createType from SerializableType as it was not that interesting. On as side-note
   container deserialization now presizes to correct capacity!
6) SerializableType now remembers the short name of its source Assembly in file state.
   It uses this in concert with the new TypeMap assembly cache to locate the Type
   at runtime. This turned out to be harder than I thought. Type.GetType requires a
   fully qualified Assembly name (unless in the local assembly or mscorlib). But the
   FQAN has the version embedded in it! I would like to follow semantic versioning rules,
   which means this string will change a lot. My solution is to store only the short
   assembly name, and then search all assemblies for the assembly that matches it (whatever
   the version is).
7) Removed initalizeAssemblyState from TypeMap. I've rethought the flows for TypeMap
   initialization. When creating ex-niliho, you call initializeFromAssemblies, and
   pass in an array of Assemblies to scan for participating types. When updating,
   you will call updateFromAssemblies, which will take both the TypeMap file and
   the Assemblies array. When using at Runtime, you will initialize via initializeFromFile,
   which will take a parameter specifying whether runtime state is mandatory.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.