I have written a new shiny Todo service with my favorite front-end and back-end framework. To minimize coupling I return data in some standard format like JSON or Protobuf and leave it up to the client to interpret and display it in a way it feels suitable.
The user can select multiple items which on selection should show different UI as compared to normal item, it can be done by adding
selected field to the objects as soon as I receive them on the client, setting them initially to false. But later I would need to sync the application state with the server and I wouldn't want to send the original data with the
selected attribute hence before sending it back to server I must remove the
selected attribute from the objects.
I need to know is this the correct approach to deal with such a situation?