-
Notifications
You must be signed in to change notification settings - Fork 864
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
implement polymorphism support for DynamoDB entries #3643
base: v4-development
Are you sure you want to change the base?
Conversation
implement DynamoDBDerivedTypeAttribute for polymorphism support update nested items for V4
Can the other PR (that was targeting V3) - #3633 - be closed? |
@dscpinheiro the issue that the PR has in scope to fix was affecting AWSSDK.DynamoDBv2 3.7.104, but as @normj instructed in #3633 the fix is raised for V4 also. |
Ok, my read from Norm's comment in the other PR was that we should only make this change for V4. But I can double-check with him offline. |
@irina-herciu Can you add a change file like you did in your previous PR. https://github.com/aws/aws-sdk-net/pull/3614/files |
@irina-herciu A concern I have is a user saves the item with .NET but another parts reads the item with a different language have a mechanism that only stores the .NET type won't be portable. The AWS Kotlin SDK has similar support for polymorphism in their high level. It supports a mechanism customers can use to control the identifier for the type and they could potentially use a language neutral identifier. Can you rework this to have some sort of system that allows users to register a type conversation mapping. By default it can rely on .NET type but if a user can opt-in their own mechanism that would unblock polyglot customers. Validation should be a customer can save a item using polymorphism in our Kotlin SDK and have a way to read it back out using your changes. My understanding in the Kotlin SDK you use the |
@normj The functionality implemented of this feature is different from the 'HeterogenerousItemConverter', as the Kotlin SDK feature is designed to convert top-level items in a DynamoDB table, meaning it applies polymorphism only when retrieving or saving items at the root level and requires a custom 'AttributeConverter' to handle polymorphic nested items. |
Change file added |
implement DynamoDBPolymorphicPropertyAttribute for polymorphism support that should solve Saving nested items with class hierarchies Saving nested items with class hierarchies #2985
implement DynamoDBPolymorphicTypeAttribute for polymorphism support for table entries
Description
New DynamoDB PropertyAttribute added as DynamoDBPolymorphicPropertyAttribute in order to add support for polymorphic property types serialization and deserialization
[DynamoDBPolymorphicProperty("B", typeof(B))]
New DynamoDB Attribute added as DynamoDBPolymorphicTypeAttribute in order to add support for polymorphic types serialization and deserialization
[DynamoDBPolymorphicType("A2", typeof(ModelA2))]
Type Attribute name can be configurable from DerivedTypeAttributeName on DynamoDBContextConfig and by default uses "$type".
Motivation and Context
#2985
Testing
Integration tests added
Screenshots (if appropriate)
Types of changes
Checklist
License