Storage Locations – Memory Only Map-Set

Storage Locations are a valuable utility in FOX. They are a definition of how and where something is stored.

SYNTAX

The following code shows what has to be included within a storage location for a memory only map-set:

<fm:storage-location name="name">
  <fm:cache-key string="string :bind"/>
  <fm:using using-type=”UNIQUE”/>
  <fm:new-document>
    <fm:root-element>map-set-list</fm:root-element>
  </fm:new-document>
</fm:storage-location>

Note, the fm:root-element will always be map-set-list when you are creating a storage location for a map-set.

CONCEPTS

Before a map-set can be used we need to define where it is held, a storage location (SL). SL’s can be defined in a number of ways, but here we look at “Memory Only” SL. The map-set values created will be cached in memory only. The cache key defines in what bucket. Note the cache key comprises a static name part, and a unique part using bind variable.

Without the unique bind variable, the map-set data will never change, because the storage location will not be changed each time it is loaded.

Standard SL’s are XML based. When SL is used for the first time no data exists. The fm:root-element specifies how to initialise the XML in this first instance. For a map-set it is always map-set-list.