I have a android app that is quite simple it fetches data from the server using protobuf and then it lets the user browse the data tree (simplified)
Now I only ever want this data in my structure so I was using the protobuf reply (through autogenerated class) as my internal dataset.
problem is I want to be able to update some data in it and also get more data from the server and attach to the tree… this is impossible due to the data being immutable.
so my question is, how do I with as little computing power as possible store my protobuf messages as a changable data structures?
do i have to make my own corresponding dataclass-structure (seems like double work) or is there any other way?
The approach i’ve used is to implement my own types which mirror the protobuf types but which allow extra functionality such as in-place modification, and also implement a set of translation functions to convert between each pair of types. I then only use the Protobuf generated classes when i actually need to send or receive something over the wire.