Maximilian
Lifer
Friendly values being instead of the database column name "satfod" it would be "Saturated Fats".
Should I:
A - Send the client a friendly values map on initial login so it can friendlyify food objects on its own if it wishes. So the server just sends arrays of food objects unaltered.
OR
B - Have the server put the friendly values into each food object so instead of the server sending just this:
It would send this:
It doubles the size of each food object but makes things less complex on the client side. What do you guys think? I am useless at design choices like this 😕 Option A is what im currently doing but im not really sure if thats the best way to go.
Should I:
A - Send the client a friendly values map on initial login so it can friendlyify food objects on its own if it wishes. So the server just sends arrays of food objects unaltered.
OR
B - Have the server put the friendly values into each food object so instead of the server sending just this:
Code:
{
protein:10,
satfod:20,
carbs50
}
It would send this:
Code:
{
values:{
protein:10,
satfod:20,
carbs:50},
friendlyValues:{
Protein:10,
Saturated Fats:20,
Carbohydrates:30}
}
It doubles the size of each food object but makes things less complex on the client side. What do you guys think? I am useless at design choices like this 😕 Option A is what im currently doing but im not really sure if thats the best way to go.