4 ms·
I agree and I believe that the way to accomplish this is to use Protocol Buffer schemas. Protocol Buffers and JSON have an extremely similar data model. The p
by haberman 13y ago
I agree and I believe that the way to accomplish this is to use Protocol Buffer schemas.
Protocol Buffers and JSON have an extremely similar data model. The parts of them that people actually use are effectively identical. The actual differences are minor things like:
- JSON can have arrays of arrays; with Protocol Buffers you need a message in between.
- Protocol Buffers can represent binary data directly; with JSON you have to base64 encode it into a string.
- Protocol Buffers are more specific about the size of integer types (int64 and int32 are different); this allows for more efficient in-memory representations but doesn't matter so much on-the-wire.
I think the two are a match made in heaven.
- bsaul 13y agoYes, i also thought of protocol buffer right after sending that comment. Although i wonder : is there any way you could automatically generate a full service/model layer for, let's say angularjs or objective-c, based solely on protocol buffer "standard" ?
- nly 13y agoYou're basically describing Piqi: http://piqi.org/ http://piqi.org/
- haberman 13y agoThanks for the reference, I hadn't seen that. I really believe, though, that the solution to interoperability is to use protocol buffer schemas directly; not to introduce yet another schema language.