I receive zip files and they have as content 8 different files, each with it's own metadata inside.
I have to combine these files into 1 object containing certain metadata. The big issue here is that there will not always be 8 files and the metadata i want to retrieve could be in any of these files stored in there own way.
for now i have created a factory method that initiates the correct parser for each file type and the parser returns the object with the metadata it was able to parse.
Now when this is done i have 8 object's i have to merge into 1 result object with the metadata gathered from these results.
so i could have something like this
object Meta1 Meta2 Meta3 Meta4 Meta5
1 A - 15 RT -
2 - - 15 - HIGH
3 A - 15 RT HIGH
4 - 65 - RT HIGH
This needs to have only 1 object as output:
Meta1 Meta2 Meta3 Meta4 Meta5
A 65 15 RT HIGH
Now i'm wondering what would be the best strategy to solve this issue
- Have my parsers accept my Object as parameter, try to map the data and override if present and then return the Object to be passed again in the next Parser
- Parse all the Object and try to merge them somehow in the end
- Another strategy?
load(file1);load(file2)
orload1(file1);load2(file2);
?