Reputation: 21
I have a python application that will be talking to a Java server. The python application will be sending out simple messages continuously to the java server with a handful of values [ For eg: Name, studentRollNumber, marks ]
I considered having this communication take place in json format since I don't want to get into plain text processing that could potentially be buggy. However, if I use json I'm going to keep transferring the names of the fields [ such as "name", "studentRollNumber" ] etc. multiple times. Is there a better way to do this ?
TL;DR What is a good way to serialize/deserialize an object into text that works in both Java and Python without being too verbose ?
Upvotes: 1
Views: 440
Reputation: 999
I don't think so.
You seem like you are heading in the right direction when you said .
I don't want to get into plain text processing that could potentially be buggy.
Which is absolutely true and why you should consider formatted text like JSON. And unfortunately any formatting means overhead : increasing the size of the data you are sending.
So you either need to improvise your own format that has the least amount of "extra stuff" in it. Or use the available ones like Json , XML ...
Upvotes: 2