-
Type:
Improvement
-
Resolution: Done
-
Priority:
Critical - P2
-
Affects Version/s: 2.14.0
-
Component/s: Serialization
-
None
-
Major Change
-
Not Needed
-
-
Level 3
-
Green
-
None
-
None
-
None
We currently rely on static/global serialization components, which makes it difficult to customize serialization behavior in a flexible and context-specific way.
This ticket proposes introducing a new serialization approach that allows passing down configuration and options, without removing the existing global/static components. The goal is to support both models in parallel, enabling more flexible and testable code while maintaining backward compatibility.
Moving away from global serialization components will allow, among the rest:
- Greater flexibility in deciding configuration based on context, for example when connecting to different MongoDB deployments
- Improved testing possibilities, possibly allowing parallel testing as well
Components affected by this work include:
- BsonSerializer
- BsonClassMap
- ConventionRegistry
- depends on
-
CSHARP-5356 Support `OfType` and `is` with scalar discriminators when using class mapped serializers
-
- Closed
-
- fixes
-
CSHARP-1114 Remove global dependencies in Bson Library
-
- Closed
-
-
CSHARP-4487 Make BsonClassMap entirely non-static
-
- Closed
-
- has to be done before
-
CSHARP-6128 Introduce a frozen "Standard" serialization domain compatible with all domains
-
- Backlog
-
-
CSHARP-6129 Fix static discriminator conventions pinned to the Default domain
-
- Backlog
-
-
CSHARP-6130 Look up conventions without taking the exclusive lock in ConventionRegistryInstance
-
- Backlog
-
-
CSHARP-6131 Consider removing IConventionPack in favor of IEnumerable<IConvention>
-
- Backlog
-
- is duplicated by
-
CSHARP-655 Proposal: support multiple serialization contexts
-
- Closed
-
- is related to
-
CSHARP-5846 Global GuidSerializer settings ignored for object-typed properties
-
- Closed
-
-
CSHARP-5082 Check if there is already a DiscriminatorConvention registered
-
- Closed
-
-
CSHARP-1114 Remove global dependencies in Bson Library
-
- Closed
-
- related to
-
CSHARP-4487 Make BsonClassMap entirely non-static
-
- Closed
-