Search code examples
javac++xmlcorba

Design decision for XML data transfer


I am implementing a profiler which collects data and sends the data via socket serialized in XML to a given host. The profiler is implemented in C++, the host (GUI) is implemented in Java.

It arises for me, putting data which belongs together into C++ classes, for instance a class ThreadInfo, containing string ThreadName, string ThreadGroup, etc.

Further this class would be serialized to XML, send via socket and the Java GUI would visualize the data.

To my question: I'm not sure, if I should use another solution. For instance just use CORBA for exchanging the classes. However the classes are not really big, and are constructed quite easily.

Would it be common to use an available solution?


Solution

  • If your classes are simple, just use a plain XML structure to serialize the data and it will be easy to write your code and efficient. However, keep in mind that if you have things like special characters, binary data etc. in your data it would be easier to use something like CORBA as they will handle all special characters and will be a breeze to code. Otherwise, just use a simple XML parser in your Java code to parse the plain XML that is passed over.

    From my personal experience, for simple structures, doing my own XML structure is clean and neat.