Open Kittyfisto opened 7 years ago
The introduction of type surrogates should make serializers for each built-in type obsolete and simplify the introduction of additional serializers as there only needs to be one surrogate (instead of one built-in serializer path per serializer).
It should be possible to create generic type surrogates for open types (such as IEnumerable<>). If such a type is defined, then it can be expected that it has the same number of parameters with identical type constraints (because a conversion to and from is needed).
The old serializer architecture will not support type surrogates, but the new architecture (which should ship in January 2018) will: Both XmlSerializer and BinarySerializer2 will support this feature upon initial release.
Built-in serializers should support only array and list implementations and all other collections shall be implemented via type surrogates (which aren't tied to any specific serializer anymore).
It should be possible to define and create type-surrogates that are used in place of the actual types in an object graph:
Every time SharpRemote tries to serialize an object of type A, its value should be converted to a ASurrogate and then serialized (as well as vice verca).