4 ms·
> The issue is when JSON has to be parsed on the server using Java/C#. How do you know whether to parse it as a Dog or as a Cat (both of which inherits from Ani
by com2kid 4y ago
> The issue is when JSON has to be parsed on the server using Java/C#. How do you know whether to parse it as a Dog or as a Cat (both of which inherits from Animal)?
I mean how MS does it, yeah, you have a tagged union, look at the tag to determine what it is.
Heck even networking packets work this way, UDP or TCP, look at the Protocol Field on the IP packet to see which it is.