Module

Perspectives.Representation.Class.Cacheable

#Identifier

type Identifier = String

Members of class Cacheable provide functionality to cache and retrieve their representation. Members are by definition also members of class Revision. We now have two dimensions:

  • is an entitity in cache?

  • do want to preserve the revision on overwriting the cache with a new value for the entity? This gives rise to four possibilities, one of which is nonsense (not cached before, but preserve the revision). These are the three remaining functions:

  • cacheInitially;

  • cachePreservingRevision: before overwriting the cached value, take its revision and store it in the new value to cache;

  • cacheOverwritingRevision: just overwrite the cached value.

#Namespace

#Cacheable

#readEntiteitFromCache

readEntiteitFromCache :: forall a i. Cacheable a i => i -> MonadPerspectives a

Returns an entity. Throws an error if the resource is not represented in cache or not immediately available in cache.

#cachePreservingRevision

cachePreservingRevision :: forall a i. Cacheable a i => i -> a -> MonadPerspectives (AVar a)

Caches the entiteit. This operation is neutral w.r.t. the revision value (ff it was cached before, ensures that the newly cached entiteit has the same revision value as the old one).

#cacheInitially

cacheInitially :: forall a i. Cacheable a i => i -> a -> MonadPerspectives (AVar a)

Store an internally created PerspectEntiteit for the first time in the local store.

#cacheOverwritingRevision

cacheOverwritingRevision :: forall a i. Cacheable a i => i -> a -> MonadPerspectives (AVar a)

Modify a PerspectEntiteit in the cache. Overwrites the revision value.

Re-exports from Perspectives.Representation.Class.Revision

#Revision_

#Revision

class Revision v  where

Members

Re-exports from Perspectives.Representation.TypeIdentifiers

Modules