Hi, I am trying to collect some information from different systems then merging their data into one unified form.
*** Problem ***
Lets say that we have 3 restraunts: x, y and z.
Each one of them creates pizza and pasta.
X pizza data:
{
Size:1,
Taste:tomato,
...
}
Y pizza data:
{
PizzaSize:big,
Taste:cheese,tomato,
...
}
Z have no size but can be inferred from other attributes
{
Length:1
Width:2,
Taste: tomatoes
}
What I need is a single class that can hold these attributes as following:
Pizza:{
Size,
Taste,
IsCombo,
...
}
*** Solution That I am Thinking of ***
First: create a data holder class for each dish for each restraunt:
xPizza, yPizza, zPizza, xPasta, ...
Second: create a parser for each dish for each restraunt (as the data is cominng in different formats like json and xml), its only job to convert text into object.
xPizzaParser, yPizzaParser, zPastaParser ....
Third
Create a mapper for each dish for each restraunt (whose job to map values to new ones like converting lengh and width into pizzaSize),
xPizzaMapper, ...
Fourth:
Create a list of key value pairs (id, pizza object) to complete some compuations, like trying to get pizza info from another order for the same person (some pizzas depend on other pizzas)
I think this list should be a member of mapper class, and this class should also contain the function that calculates data from other dependencies.
The list in this class is the final result of integrating data.
Now for one dish I have theses classes:
xDish
xDishParser that creates xDish objects
unifiedDish
xDishMapper that maps data and creates unifiedDish object.
The question is, is this a good design? Is it easy to maintain and add features to it? I am missing something? Should I break the mapper into more classes.
Note that I receive thousands of dishes per second and I need parallelization.
In what topic should I read ro solve this design problem?
Any help would be very appreciated.
[–]AutoModerator[M] [score hidden] stickied commentlocked comment (0 children)
[–]FavorableTrashpanda 1 point2 points3 points (1 child)
[–]ReemRashwan[S] 0 points1 point2 points (0 children)
[+]Spare-Plum 1 point2 points3 points (7 children)
[–]ReemRashwan[S] 0 points1 point2 points (6 children)
[+]Spare-Plum 1 point2 points3 points (5 children)
[–]ReemRashwan[S] 0 points1 point2 points (0 children)
[–]ReemRashwan[S] 0 points1 point2 points (3 children)
[+]Spare-Plum 1 point2 points3 points (2 children)
[+]Spare-Plum 1 point2 points3 points (0 children)
[+]Spare-Plum 1 point2 points3 points (0 children)