Click here to Skip to main content
15,889,867 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi I am developing large client server application. One client in different VMs and several servers on other VMs.
User creates entities in GUI
The GUI sends message via RabbitMQ to the server and the servers stores it in DB
The customer asked to implement undo redu operations between each save command.
Were the undo redu should be implemented? in the client? or server?
Thank you

What I have tried:

I am still in design level. Please suggest me correct way to design it.
Posted
Updated 18-Apr-21 23:03pm
v2

1 solution

It depends :)
If data is prepared as single enity, which is then sent to server and saved, you can have undo on client. You will need simple queue of commands.
If data is continously sent to server, you must implement undo on server, with added undo command. In this case you have to be careful with multiuser environment. This means you need extra table on server to store list of commands for every user. On client you call undo command on server and get back older version of data. What is old version and how you get it is different on how you store data. Simplest is saving new version and invalidate previous. Then you just send apropriate data back to client. More involved variant is to execute (on server) undo command on current version, save corrected version and send it back to client.
In every case you need to structure command and their undo and every change to data goes through command and parameters.
Hope this helps
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900