akka.net icon indicating copy to clipboard operation
akka.net copied to clipboard

Create an article "Immutable message and serialization"

Open alexvaluyskiy opened this issue 7 years ago • 2 comments

Base on these articles http://getakka.net/docs/concepts/messages http://akkanetdocfx.azurewebsites.net/articles/actors/untyped-actor-api.html#messages-and-immutability

alexvaluyskiy avatar May 14 '17 16:05 alexvaluyskiy

You mean as a document under "Concepts" ? Or something else ?

Danthar avatar May 15 '17 13:05 Danthar

Yes, in "concepts". I think we should have a recommendation for messages. For example

  • DO create immutable messages
  • AVOID using complex types which should not be designed for serialization, like Lazy, StringBuilder
  • AVOID using exceptions in your messages, unless your serializer supports them
  • AVOID usingobject type in your messages.
  • AVOID circular references in your messages
  • DO NOT create more than one constructor in a message. You serializer-provided attributes to mark a default constructor

alexvaluyskiy avatar May 15 '17 15:05 alexvaluyskiy