sageserpent-open / plutonium

CQRS providing bitemporal object modelling for Java POJOs and Scala too.
MIT License
5 stars 0 forks source link

Deal with type tag serialization in a nice, maintainable way. #45

Open sageserpent-open opened 6 years ago

sageserpent-open commented 6 years ago

Serialization of type tags has caused a lot of problems in both the Redis and efficient world implementations. The current state of play is to intercept serialization of 'UniqueItemSpecification' and convert the type tag to and from the equivalent Java class instance, or if the type tag does not correspond to a realisable Java class (e.g 'Any', 'AnyVal' or 'Nothing'), just treat it as 'Any' and hope for the best, which for now works fine as the 'Nothing' case is not going to happen for real data, and the value types for ids so far end up being boxed, well, that's what I think is happening.

sageserpent-open commented 6 years ago

I forgot to mention that owing to a poor interaction between the type tag hierarchy and Kryo, it is also not possible with the techniques used thus far to register a serializer directly for 'TypeTag'.

sageserpent-open commented 6 years ago

The plan here is to sort this mess out - the code as of tag AllTestsPassAndItScalesProperly does what the tag says, but there are just too many bits of arcane knowledge involved in the implementation.