Skip to content

Modifying Objects

Jan Wiemer edited this page Dec 28, 2020 · 4 revisions

Modifying Objects

There are a few methods in the API of the JACIS store to modify the stored objects:

void update(K key, TV value);

Update the object with the passed key to the new passed value.

void remove(K key);

Remove the object with the passed key from the store.

The API to modify objects is quite simple since only a method to update the value for a key and a method to remove the value for a key is needed. If we want to create objects we simply use the update method as well. Regardless which changes we do for an object we simply pass the new value to the update method. Note that by default there is no automatic dirty check. Therefore all modifications to objects read from the store have to be notified to the store explicitly by calling the update method. Modifications done to objects without calling the method are simply ignored. Note that the order of calling the update method and doing the modifications does not matter. If we first call the update method and then modify the passed instance the changes will also be cloned back to the store on commit. However changes done to the passed instance after commit will have no effect on the store.

Next Chapter: Read-Only-Objects

Clone this wiki locally