Re:Dynamic type systems are not inherently more open
by msangi on Sunday January 19, 2020 @02:21PM
(#22093330)
With protobufs you get bytes that you have to parse with defined rules on what to do with unexpected and missing fields.
How’s it different from the proposed model where you start by parsing the data you receive and, once it’s parsed and know it’s good, you process it?
Re:Dynamic type systems are not inherently more open
by skybrian on Sunday January 19, 2020 @05:02PM
(#22094428)
It probably would work, provided that each client takes the original proto file and removes all the fields they don't use, so they are treated as unknown fields?
I don't know if there's a supported way to do this, though. To leverage it for refactoring, there would also need to be a way to do a query to find out out which clients use which fields.
Maybe clients should declare their own types containing just what they need and copy the data into them from the protobufs? But this does get tedious. On the other hand, in a schemaless JSON system, there is nothing statically checking that the clients and servers have compatible ideas of what a message should contain.