3 ms·
Type safety for your serialization/RPC layer.
by q3k 6y ago
Type safety for your serialization/RPC layer.
- jeffbee 6y agoProtobuf does not provide any type safety whatsoever. The name of the type of the message is carried in a side-channel, and the interpretation of that name is completely up to the endpoint that deserializes the message.
- q3k 6y agoOnce you dispatch your binary/text protobuf into a proto message type however, you do get type safety, and it makes sense to carry over that type safety to implementing languages. Plus, Any [1] is an effort to standardize the ability to carry the proto type (as a global identifier that can be used to retrieve its schema) alongside its serialized format. [1] - https://developers.google.com/protocol-buffers/docs/proto3#any https://developers.google.com/protocol-buffers/docs/proto3#a...