perfview icon indicating copy to clipboard operation
perfview copied to clipboard

Breaking Changes for FastSerialization

Open brianrob opened this issue 1 year ago • 0 comments

Implements a set of breaking changes for FastSerialization.

Highlights:

  • SerializationSettings are now required when creating a stream for use with FastSerialization.
  • All non-primitive types must be registered with Deserializer before they can be deserialized. Failure to do so will cause the deserialization operation to fail.

More Details:

  • Rename SerializationConfiguration to SerializationSettings and make it a required parameter when creating a stream for use with FastSerialization.
  • Make SerializationSettings read-only once passed into a reader or writer implementation by cloning the object whenever a setting is changed.
  • Move StreamReaderAlignment from an optional parameter to reader constructors to a property on SerializationSettings.
  • All non-primitive types must be registered with Deserializer before they can be deserialized. Failure to do so will cause the deserialization operation to fail. Registration can occur via a call to Deserializer.RegisterType or Deserializer.RegisterFactory.
  • Deserializer also supports on-the-fly registration of types and factories via the Deserializer.OnUnregisteredType event.
  • Removed Deserializer.RegisterDefaultFactory and Deserializer.TypeResolver in favor of Deserializer.OnUnregisteredType which allows for type resolution and factory creation to be performed in one place instead of two.

brianrob avatar Oct 18 '24 19:10 brianrob