3 ms·
> I think protos might just be being used for the wrong thing in the author’s example. You shouldn’t replace your application’s data structures with protos ever
by davedx 7y ago
> I think protos might just be being used for the wrong thing in the author’s example. You shouldn’t replace your application’s data structures with protos everywhere
Yeah, I really scratched my head at that part. Even in my small line-of-business TypeScript apps, I often have separate interfaces for the "API models" (what I get as JSON from the API) and the "app models" (the models my app uses to represent the internal state of things).
In the big .NET platform I work on, we have multiple namespaces of Models and Dto's to represent different things at different interface boundaries.
Why on earth would you try to re-use a network-layer interface in levels several layers higher? That's crazy talk!
- kentonv 7y ago> Why on earth would you try to re-use a network-layer interface in levels several layers higher? That's crazy talk! It's theoretically ugly but in practice it can be really convenient. Translating large structures between different formats is tedious and error-prone... sometimes it's just a lot faster and easier to leave it as a Protobuf.