dan ionescu
dan ionescu

Reputation: 129

ProtoInclude adds unwanted dependencies

I just replaced .NET serialization with protocol buffers in a distributed cache application and the results are really impressive. The only thing I do not like is the fact that I need to add dependencies between a base message class and its children which creates a circular dependency. Is there an alternative to tagging base class with ProtoInclude?

Upvotes: 4

Views: 595

Answers (1)

Marc Gravell
Marc Gravell

Reputation: 1062945

In v1; [ProtoInclude] is the only way to support inheritance.

In v2, you can use MetaType's .AddSubType(...) method to achieve the same thing, without requiring your base-type to know about the derived type(s).

Upvotes: 5

Related Questions