I need to move math league data between two different systems, both written in Java. The data is coming from a Java web application, backed by a MySQL Database, where I have tables of Schools and Students, both with unique id numbers. The data needs to be exported into a format I can read off-line with a desktop client used to record scores on the day of a tournament event in February.
The client stores the data right now as a CSV file which has the nice advantage of allowing people to load the entire “database” into Excel to view the scores of every student from every team. Last year this format was problematic because somehow the data became corrupt (there was some redundancy in the data entry because some people filled out the wrong team number on the score card and then my data entry team fed bad data into the system)
I would like to update the client to store data in a more structured way and just leave the CSV file as an export-only feature. I would choose XML serialization because I’m the most familiar with that. But I’m curious about the advantages of JSON or YAML.
At the same time, I need to add some export feature to the web application that will let me move some data into a format that the desktop client can read. Users of the web application (math team coaches) will select which students are going to the tournament and then I will download some file that my client can read. The data structure will be:
team id
school name
student1
student2
student3
student4
student5
Where each student object consists of an id number, name, and a few fields for scores.
Does straight XML make the most sense here or would something else be easier?
The main objection I’ve seen to XML is that it can be very verbose. You seem to be dealing with relatively small amounts of data in an environment in which verifiable structure is important. I think I would go with XML for that.