Skip to content

Renaming serialize/deserialize methods to serializeTo/serializeFrom and deserializeTo/deserializeFrom#3880

Merged
LeStarch merged 12 commits intonasa:develfrom
vincewoo:FP-3781
Jul 24, 2025
Merged

Renaming serialize/deserialize methods to serializeTo/serializeFrom and deserializeTo/deserializeFrom#3880
LeStarch merged 12 commits intonasa:develfrom
vincewoo:FP-3781

Conversation

@vincewoo
Copy link
Contributor

Related Issue(s) #3781
Has Unit Tests (y/n) y, pre-existing tests updated
Documentation Included (y/n) n

Change Description

This change is part of the #3599 suggestions for code consistency. It is primarily a set of function name changes to clarify the direction of serialization and deserialization. In general, F' we has two flavors of serialization methods:

  1. <buffer>.serialize(<element>)
  2. <element>.serialize(<buffer>)

These both mean that the element is being serialized to the buffer. Whereas the following two flavors of deserialize methods mean that we are deserializing from the buffer to the element.

  1. <buffer>.deserialize(<element>)
  2. <element>.deserialize(<buffer>)

To improve the understanding of the direction of the serialization/deserialization this change renames the functions to serializeTo/serializeFrom and deserializeTo/deserializeFrom.

Rationale

Improve readability of F' code to allow quicker assessment of serialization/deserialization direction.

Testing/Review Recommendations

Unit testing was updated with new function names and re-run, 100% passing.

Future Work

Will need to update FPP shortly afterwards to auto-code new function names.

vincewoo added 2 commits July 9, 2025 18:07
…ializeFrom and deserializeTo/deserializeFrom methods to indicate direction.
@vincewoo vincewoo changed the title Deprecating serialize/deserialize methods for clearer serializeTo/serializeFrom and deserializeTo/deserializeFrom methods to indicate direction. Renaming serialize/deserialize methods to serializeTo/serializeFrom and deserializeTo/deserializeFrom Jul 14, 2025
@vincewoo
Copy link
Contributor Author

Looks like we'll have to go forward with our plan to implement the FPP changes in tandem with this one. There doesn't seem to be a good way to decouple here.

@vincewoo vincewoo marked this pull request as draft July 15, 2025 22:08
Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

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

CodeQL found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

…ity fall-back logic to aid in FPP decoupling.
@LeStarch LeStarch added this to the Release v4.0.0a2 milestone Jul 23, 2025
@thomas-bc thomas-bc marked this pull request as ready for review July 23, 2025 21:13
@thomas-bc thomas-bc self-requested a review July 23, 2025 21:14
Copy link
Collaborator

@thomas-bc thomas-bc left a comment

Choose a reason for hiding this comment

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

Last few nits and question

Thanks a lot, this is great work!

@vincewoo vincewoo requested a review from thomas-bc July 24, 2025 18:01
Copy link
Collaborator

@thomas-bc thomas-bc left a comment

Choose a reason for hiding this comment

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

Looks good to me! Thanks a lot

@LeStarch LeStarch merged commit 379d305 into nasa:devel Jul 24, 2025
49 checks passed
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