I have currently completed one of two phases of a project that requires me to write database information in XML using C ++. Although the use of a third-party tool was used to actually format XML tags and data, I still had to develop a model along with business logic to accept database tables and map them to XML structures.
To do this, I created an individual class for each XML structure, which led to a large number of classes (~ 75). Each class knew how to read the table associated with it and serialize itself in XML through a third-party tool. As a result, the system worked very well (in terms of time and budget), and output errors were very easy to find.
The second phase is almost identical, but instead of formatted text, it will be binary data. Therefore, although I am still considering using the same strategy as in the first phase, I would like to know if there is a better design method or template that can succumb to this problem? In particular, due to the large number of dependencies in some XML classes, unit testing was very difficult at the first stage.
source share