Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>This is my solution:</p> <ol> <li><p>Let the client check if the text was modified. If not, tell the server there was no modification. If this is not possible have the client send both the orinigial text and the modified text, and then the server will be able to check if it was modified. (if it wasn't then there is no need to touch the data you are storing). This applies for both desktop and web enviroments.</p></li> <li><p>Preferibly don't use a list, use a set (may be a hashset). The set will only allow to have each item once. In case you can't I guess you can continue using the list. If I understand correctly you are using a database, so if you could interface with the database engine directly instead of syncing the list (or set) your application will have a performance boost.</p></li> <li><p>Convert the edition of the list/set into a add-remove pair (instead of setting the item). Have it check if the list/set contains the new value before doing any modification. If the new value is already present then you can throw an exception or send a message to the client (or whatever is more appropiate for your enviroment).</p></li> <li><p>You may want to sync the access to your list/set, keep it simple: use a lock (Monitor). I would consider a read-write lock, but that is complicating things while you are learning. [If you interface directly with the database engine, you can let it handle that instead]. Note: there is no need for this if you will only have one single client... ever (unless that single client can send multiple concurrent requests... :P).</p></li> </ol>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload