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

Docs: Actor serialization documentation #1199

Closed
wants to merge 3 commits into from

Conversation

WhitWaldo
Copy link
Contributor

Description

This is my first draft of a new page in the documentation detailing how serialization works using the Dapr .NET Actors SDK today. It's my response to the issue raised here which is marked as a bug, but reflects a misunderstanding of how the serialization engine handles records. My goal with adding this page is to provide an upfront resource for developers using actors to understand why serialization may not be working as expected out of the box and provide not only a solution, but an explanation.

I detail how serialization is performed to illustrate the benefits to either going the parameterless constructor route or decorating types and members with the applicable attributes and then share my recommendation to use attributes and why. I dive through several examples documenting expectations in classes, structs and records and then speak a bit to other related scenarios (collections, enums, polymorphic types) towards the end pointing back to the official documentation to keep this document from getting too verbose.

This is a documentation update only and changes no code in the SDK.

Issue reference

We strive to have all PR being opened based on an issue, where the problem or feature have been discussed prior to implementation.

Please reference the issue this PR will close: #679

Checklist

Please make sure you've completed the relevant tasks for this PR, out of the following list:

* [ ] Code compiles correctly
* [ ] Created/updated tests

  • Extended the documentation

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>
@WhitWaldo WhitWaldo requested review from a team as code owners December 1, 2023 10:26
Copy link

codecov bot commented Dec 1, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (10ef818) 66.53% compared to head (efa3598) 66.53%.

❗ Current head efa3598 differs from pull request most recent head 557861c. Consider uploading reports for the commit 557861c to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1199   +/-   ##
=======================================
  Coverage   66.53%   66.53%           
=======================================
  Files         171      171           
  Lines        5752     5752           
  Branches      626      626           
=======================================
  Hits         3827     3827           
  Misses       1776     1776           
  Partials      149      149           
Flag Coverage Δ
net6 66.52% <ø> (ø)
net7 66.52% <ø> (ø)
net8 66.52% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Whit Waldo <whit.waldo@innovian.net)
Copy link
Collaborator

@philliphoff philliphoff left a comment

Choose a reason for hiding this comment

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

Overall a fantastic summary of DataContract based serialization. The only thought I had was whether to further emphasize the official .NET docs at the beginning as "the final word" in serialization, as much of this is not Dapr-specific and subject to change with the .NET Framework rather than Dapr.

…ization development

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>
@WhitWaldo
Copy link
Contributor Author

Overall a fantastic summary of DataContract based serialization. The only thought I had was whether to further emphasize the official .NET docs at the beginning as "the final word" in serialization, as much of this is not Dapr-specific and subject to change with the .NET Framework rather than Dapr.

I think that's an excellent addition. I've called that out separately and linked to the implementation in the .NET Github repo.

@halspang
Copy link
Contributor

halspang commented Jan 6, 2024

@WhitWaldo - Thanks for your contribution! Can you sign-off on your commit so DCO will pass?

@WhitWaldo
Copy link
Contributor Author

WhitWaldo commented Jan 6, 2024

@halspang You're right - found that one of the commits had a bad punctuation mark. Can't figure out how to amend it since it wasn't the latest commit, so I've taken the latest file and put it into a new PR instead at #1222

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.

Can't use C# 9.0 Record for actor method return type
3 participants