Implement IMobileObjectMetastate interface#4750
Conversation
|
If it handles round-tripping these fields and lets me get rid of this code,, then yes. Specifically, fields like But, the way this is implemented, there's still Reflection involved. I'm not sure that's ideal. Couldn't each BO implement Basically, |
|
The updated implementation is much simpler - doesn't use the @JasonBock you don't care what is in the byte array I assume? It is JSON in this case, but you are just going to treat it like a blob I assume? |
There was a problem hiding this comment.
Pull Request Overview
This PR implements the IMobileObjectMetastate interface to provide a lightweight serialization mechanism for mobile objects. The interface allows objects to serialize their field values (metastate) to and from byte arrays, specifically excluding child object references.
Key Changes:
- Introduces
IMobileObjectMetastateinterface withGetMetastate()andSetMetastate()methods - Implements the interface in
MobileObjectandMobileBindingList<T>base classes - Creates
MobileObjectMetastateHelperfor JSON-based serialization/deserialization of metastate
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| IMobileObjectMetastate.cs | New interface defining metastate serialization contract |
| MobileObjectMetastateHelper.cs | Helper class implementing JSON serialization logic for metastate |
| MobileObject.cs | Implements IMobileObjectMetastate interface with explicit interface implementation |
| MobileBindingList.cs | Implements IMobileObjectMetastate interface with explicit interface implementation |
| MobileObjectMetastateTests.cs | Test coverage for metastate serialization with BrokenRule examples |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Correct, I don't care what's in the array. I assume the implementor knows what they're doing ;) |
That's just silliness! |
Closes #4263
@JasonBock does this match your thoughts?