I have an array filled with objects , queried from a database and this array is displayed as a table to the user.
The user wants to delete 1 item so the server receives the request from the client and updates the database accordingly.
Question : How should I update the user's view ?
should I requery the Database again and select everything from it and reasign it to my model or should I do a fast array.remove(element)
?
Which one is the preferred method ?
If you are dealing with a real world application than you should always query the DB for fresh result. Doing this ensures,
So re-query the Database again and select everything from it and reassign it to your model.