New answers tagged

0

It looks to me like you could accomplish a lot of this by re-using a common struct between the client instance, the on-the-wire data, and the server instance. public class Character { // Data that needs replication over the network. public struct DTO { public int level; public int experience; public int life; // ......


1

Using DTO solely to convert to and from JSON means given DTO defines a JSON shema. Good news is that JSON can work without (explicitly defined) schema just fine and JSON does not care what class to serialize from / deserialize to — which allows to map JSON to a dictionary (and back). It means you can get rid of a DTO entirely. Moreover, if de/serialization ...


Top 50 recent answers are included