Skip to content

Circular references? #8

@d-markey

Description

@d-markey

Hello,

I like very much this idea, thanks for this proposition.

I have one question regarding custom and nested objects, and especially situations where nested objects create circular dependencies (Person B is in Person A's list of friends, and surely A will also be in B's friends! Brothers and sisters have at least one parent in common too).

This would require a serialization context to be passed around when decoding/encoding a full payload. Would you leave that aspect to implementers of the protocol or would it make sense to modify the interfaces and have the decode/encode methods accept an optional serialization context object?

Thinking about it, this could also help serializers that don't support circular dependencies (eg. JSON, CSV...) to detect such situations and throw an exception instead of eventually failing because of insufficient memory / stack space. So maybe a serialization context would be mandatory after all?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions