-
Notifications
You must be signed in to change notification settings - Fork 323
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
[C#] Support for immutable type definitions #439
Comments
The gbc C# mode flag If someone were interested in contributing to codegen to have it generate full constructors, that would be a nice thing to have. I think the design here is that the constructors are behind a flag like In our spare time, @ant0nsc and I are working on F# support. Things like annotated records and gbc-based codegen. This has resulted in our doing much of the ground work for immutable, construct-only types. Since this is a spare-time thing for both of us, I can't give you a time line for when it will ship. There a distinct possibility that the classes generated by |
"write the constructor by hand" - I assume that means we do that in a related |
I don't have a specific example to point you at, but I just got the following to work: foo.bond
foo.cs
foo.csproj
|
Thanks Chris, that should work fine - appreciate the sample |
In order to fully implement immutable types an option is needed to to allow read only collection properties. There is already an option to use interfaces rather than concrete collection types, maybe an option can be added to use read only collection interfaces or immutable collection. |
Right now Bond constraints serialized types to expose default constructor and properties with public getters/setters. One of the possible use cases for bond would be a message-driven systems, where message immutability is highly desired.
It would be great if Bond wouldn't require types to have public default constructors and support readonly fields and properties. A lot of high-perf serializers supports those features i.e. protobuf or Hyperion.
The text was updated successfully, but these errors were encountered: