When a user comes to the site, an empty Trash is created on the client and server side. When he adds the product to SC, an RPC call is made to add the product to the server. We need to make the same client side to synchronize and update the user interface. If we do not move on to a view that has a link to the old SC. The user interface will not be updated accordingly (empty SC, while it has one product).
Solution 1
The RPC call returns the updated SC and does clientSC = returnedSC. It is not very efficient because its data is transmitted over a cable.
Decision 2
The RPC call returns the added product and, on the client side, calls a method addProductthat adds the product to the list, and does not store it in the data store (for example, on the server side).
Decision 3
Same as solution 2, but use the event to notify speakers (I use the MVP template) who have a link to SC.
Which one is the best, in general, is it best to synchronize the client and server model?
source
share