You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, when SerializationMananger is scanning types in FindSerializationInfo, it checks types for the [RegisterSerializer] attribute and calls their Register method if one is found.
Since Register is a static, parameterless method, implementations currently call into the static SerializationManager.Register method to register serialization delegates.
With SerializationManager becoming non-static, a change needs to be made here and I see two options:
Remove [RegisterSerializer] and Register altogether and instead rely on [Serializer(typeof(TargetType))] attributes like we do in our generated code.
Change the signature of the Register method so that it takes a parameter of type SerializationManager or some purpose-built interface like so:
My preference here would be for the SerializationManager to be agnostic to how registration occurs. That is, there can be an assembly processor that finds serializers and registers them with the SerializationManager, a test harness that registers them, some configuration logic that registers them, or any number of other systems that register them, but the SerializationManager is independent of these methods. All these methods depend on the SerializationManager, but the SerializationManager itself is agnostic.
@galvesribeiro that can come later. This effectively removes SerializationManager out of the registration path, so registration can happen however we want.
Currently, when
SerializationMananger
is scanning types inFindSerializationInfo
, it checks types for the[RegisterSerializer]
attribute and calls theirRegister
method if one is found.Since
Register
is a static, parameterless method, implementations currently call into the staticSerializationManager.Register
method to register serialization delegates.With
SerializationManager
becoming non-static, a change needs to be made here and I see two options:[RegisterSerializer]
andRegister
altogether and instead rely on[Serializer(typeof(TargetType))]
attributes like we do in our generated code.Register
method so that it takes a parameter of typeSerializationManager
or some purpose-built interface like so:I'm in favor of the 1st option. What do you think?
The text was updated successfully, but these errors were encountered: