-
Type:
Improvement
-
Resolution: Unresolved
-
Priority:
Critical - P2
-
None
-
Affects Version/s: 2.14.0
-
Component/s: Serialization
-
None
-
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
-
- is duplicated by
-
CSHARP-655 Proposal: support multiple serialization contexts
-
- Closed
-
- is related to
-
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
-