Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
Client/Server communcation (SharedState) with a map or array with large dat
In my understanding, by using shared state, if you modify only one element in an array or in a map, it will transmit the entire thing. How do you deal with that if the data in that map/array is big and you want to optimize for performance.
E.g. you have say 500 items in that array and only one or two are changing once in a while.
Obviously having 500 fields in the shared state is not feasible. On the other hand, transmitting all 500 items every time a single item changes is very heavy and slow.
It would be nice to only transmit the delta of the array.
Thanks!
Yes, unfortunately shared state does not support deltas. You can work around it by using RPC calls instead, eg. something like
interface MyDiffRpc extends ClientRpc {
public void sendWholeThing(List<Foo> list);
public void updateElem(int i, Foo newElem);
public void insertElem(int i, Foo insertedElem);
public void removeElem(int i);
}