RSS start | index | login or register | find | edit
Online for 7767 days.




sticky snips:



no backlinks


22 active users:

unknown (22)

Recent edits:

DonDo stick
by unknown, a long time ago

skizz.plus.com/mywiki/DonDo

IStore {
key Add(object);
object Get(key);
void Init(IStore prev);
void Flush();
}

When the CacheStore is initialised, it calls the FileStore's Init(IStore prev) method. The FileStore then deserialises all the objects it has stored in previous sessions, and plays them back into the cache (that is it calls prev.Add(obj). This means that the cache is now fully populated.

A CacheStore.Get will either return an object if it is in the cache, or delegate to the next IStore, in this case a FileStore, which returns null.

On Add, the CacheStore just adds the object to its local cache. But when Flush() is called it calls Add on the FileStore for each object it has cached, and all state is serialized to the file.



No attachments for this snip.
Upload / manage attachments!
  c'est un vanilla site