Skip to content

Conversation

@ianbotsf
Copy link
Contributor

Issue #

#472

Description of changes

This PR refactors the converter interfaces used in DynamoDB Mapper to improve their semantics, composability, and reusability based on learnings from Dev Preview. Notable improvements:

  • Converter data are no longer referenced in terms of "from" and "to", which inaccurately portrayed converters as unidirectional. Now, data are referenced in terms of "left" and "right". By convention, "left" refers to data types which are closer to the caller's business logic (e.g., high-level Kotlin objects) while "right" refers to data types which are farther from the caller's business logic (e.g., DynamoDB Item/AttributeValue instances).
  • Converters are now chained with the +/plus operator rather than andThenTo which also inaccurately conveyed unidirectionality.
  • Removed SplittingConverter which was a confusing and overly-complex construct. Also removed the related class Either.
  • The names of converter implementations in DynamoDB Mapper now explicitly include ItemConverter or ValueConverter to disambiguate the type of object handled.
  • ItemConverter no longer contains a conversion overload for limiting the set of attributes to be converted, which is now handled exclusively by Item.intersectKeys. ItemConverter is now a straightforward typealias ItemConverter<T> = Converter<T, Item>.

Review guide

There are a lot of changes in this PR but many are renames and moves. I'd advise skimming the codegen changes but paying more attention to changes in :hll-mapping-core and :dynamodb-mapper. In particular, I recommend proceeding in this fashion:

  1. The new README.md in :hll-mapping-core
  2. The converter/monoconverter implementations in :hll-mapping-core
  3. The updated converter implementations in :dynamodb-mapper

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@ianbotsf ianbotsf requested a review from a team as a code owner November 14, 2025 19:44
@github-actions
Copy link

A new generated diff is ready to view.

  • No codegen difference in the AWS SDK

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.

1 participant