Skip to content

Conversation

@dnickless
Copy link
Contributor

@dnickless dnickless commented Jun 21, 2017

The BsonClassMapSerializer.DeserializeClass(BsonDeserializationContext context) method contained code to handle two basic cases depending on the value of _classMap.HasCreatorMaps: The deserialization using a Dictionary<string, object> and the "standard" deserialization. By introducing a strategy pattern I could reduce branching (minor performance gain in theory but potentially wiped out due to additional method calls, I get varying results...) and refactor the code into a more OO kind of layout.

@dnickless dnickless changed the title Strategy pattern for class serialization logic --> less spaghetti code + minor deserialization performance gain Strategy pattern for class serialization logic Jun 22, 2017
@dnickless dnickless changed the title Strategy pattern for class serialization logic Strategy pattern for BsonClassMapSerializer Jun 22, 2017
@dnickless dnickless force-pushed the BsonClassMapSerializer_Refactor_to_OO branch from 0217ba2 to 5a2f815 Compare October 5, 2018 08:48
@dnickless dnickless force-pushed the BsonClassMapSerializer_Refactor_to_OO branch from 5a2f815 to 2083538 Compare February 21, 2019 00:06
Daniel Hegener and others added 4 commits December 9, 2020 05:59
…anching and shift towards an OO/composition based code style
…aging static variables inside the generic BsonClassMapSerializer<TClass>.ClassDeserializationStrategy type
@dnickless dnickless force-pushed the BsonClassMapSerializer_Refactor_to_OO branch from 2083538 to 2cea649 Compare December 9, 2020 05:36
@dnickless
Copy link
Contributor Author

I just rebased and optimized the suggested refactoring. Also, there now is some performance-relevant change (less repeated usage of reflection) included which - should you wish not to merge the refactoring part - could be applied to the current code base separately.

@BorisDog BorisDog self-requested a review February 9, 2024 17:40
@BorisDog
Copy link
Contributor

BorisDog commented Mar 4, 2024

Hi @dnickless, thank you for this architectural improvement suggestion.
We are going to make some major refactoring in this area in scope of improving serialization epic CSHARP-3230, and unfortunately the proposed changes don't align with the current roadmap.
Therefore we are closing this PR.

@BorisDog BorisDog closed this Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants