Skip to content
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

DOCSP-36217: polymorphic serialization #163

Merged
merged 6 commits into from
Jul 10, 2024

Conversation

rustagir
Copy link
Collaborator

@rustagir rustagir commented Jun 28, 2024

Pull Request Info

PR Reviewing Guidelines

JIRA - https://jira.mongodb.org/browse/DOCSP-36217
Staging - https://preview-mongodbrustagir.gatsbyjs.io/kotlin/DOCSP-36217-polymorphic/fundamentals/data-formats/serialization/#polymorphic-serialization

Self-Review Checklist

  • Is this free of any warnings or errors in the RST?
  • Did you run a spell-check?
  • Did you run a grammar-check?
  • Are all the links working?
  • Are the facets and meta keywords accurate?

Copy link
Collaborator

@mcmorisi mcmorisi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with a couple of callouts!

Comment on lines 269 to 270
In this example, you create an interface and two data classes that
inherit that interface. In the data classes, the ``id`` field is marked
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit

Suggested change
In this example, you create an interface and two data classes that
inherit that interface. In the data classes, the ``id`` field is marked
The following example creates an interface and two data classes that
inherit that interface. In the data classes, the ``id`` field is marked

Comment on lines 277 to 282
Then, you can perform operations with data classes as usual. In the
following example, you parametrize the collection with the ``Person``
interface, but you can perform operations with the polymorphic classes
``Teacher`` and ``Student``. When you retrieve documents, the driver
automatically detects the type based on the discriminator value and
deserializes them accordingly.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit (these are based on the way we seem to typically introduce examples, let me know if I'm on the wrong track here).

Suggested change
Then, you can perform operations with data classes as usual. In the
following example, you parametrize the collection with the ``Person``
interface, but you can perform operations with the polymorphic classes
``Teacher`` and ``Student``. When you retrieve documents, the driver
automatically detects the type based on the discriminator value and
deserializes them accordingly.
Then, you can perform operations with data classes as usual. The following
example parametrizes the collection with the ``Person``
interface and performs operations with the polymorphic classes
``Teacher`` and ``Student``. When you retrieve documents, the driver
automatically detects the type based on the discriminator value and
deserializes them accordingly.

@rustagir rustagir requested a review from rozza July 1, 2024 13:53
Copy link
Member

@rozza rozza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@rustagir rustagir merged commit b5a5af9 into mongodb:master Jul 10, 2024
5 checks passed
rustagir added a commit that referenced this pull request Jul 10, 2024
* DOCSP-36217: polymorphic serialization

* wip

* wip

* wip

* fix error in codectest

* MM PR fixes 1

(cherry picked from commit b5a5af9)
@docs-builder-bot
Copy link
Collaborator

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.

4 participants