-
Notifications
You must be signed in to change notification settings - Fork 24
Mach II 1.6 Changes During Beta Release
This is a working document and may not reflect the latest commits to the repository.
During the beta release of Mach-II 1.6, several minor changes were made to the framework in order to streamline the framework's syntax or to fix functional or design defects. This document is aimed towards those currently using Mach-II 1.6 so they can update applications that utilize the beta version of the framework.
The cache
command had two changes to the syntax:
- The attribute
alias
was changed toaliases
. This change was made to keep the syntax inline with current XML syntax and to reflect that the attribute can accept a list of aliases instead of a single alias. - The attribute
name
was changes tostrategyName
. The old attribute was confusing as it refers to the caching strategy name to use for the cache block. The attributename
in thecache
command was changed tostrategyName
. This change was made to better reflect what the attribute controls as the old name was rather ambiguous.
Old Syntax - 1.6 Beta
<cache id="uniqueName" name="generalPage" alias="list,of,aliases" />
New Syntax - 1.6 RC and higher
<cache id="uniqueName" strategyName="generalPage" aliases="list,of,aliases" />
The cache-clear
command had three changes to the syntax:
- The attribute
id
was changed toids
. This change was made to keep the syntax inline with current XML syntax and to reflect that the attribute can accept a list of ids instead of a single id. - The attribute
alias
was changed toaliases
. This change was made to keep the syntax inline with current XML syntax and to reflect that the attribute can accept a list of aliases instead of asingle alias. - The attribute
name
was changed tostrategyNames
. The old attribute was confusing as it refers to the caching strategy name to use for the cache block. This change was made to better reflect what the attribute controls as the old name was rather ambiguous and to reflect that the attribute can accept a list of strategy names instead of a single strategy name.
Old Syntax - 1.6 Beta
<cache-clear id="multiple,Ids," />
<cache-clear alias="list,of,aliases" />
<cache-clear name="generalPage,colors" />
New Syntax - 1.6 RC and higher
<cache-clear ids="multiple,Ids," />
<cache-clear aliases="list,of,aliases" />
<cache-clear strategyNames="generalPage,colors" />
The cache-clear
command had one addition to the syntax (this was available in the Beta except it was not documented):
- The attribute named
condition
takes an expression (that should evaluate true/false) that indicates whether or not to clear the cache. This attribute uses the new ExpressionEvaluator syntax. The evaluator usesevent
andproperties
as indicator to get an event arg or property.
Gets an arg named something
from the Event object (which should evaluate true/false):
<cache-clear ids="home" condition="event.something" />
In the background, the ExpressionEvaluator gets the current Event object and gets the arg (e.g. event.getArg('something')
).
Gets an arg named someOtherThing
from the Event object and evaluates the expression (which should evaluate true/false):
<cache-clear ids="home" condition="event.someOtherThing GT 10" />
In the background, the ExpressionEvaluator gets the current Event object and gets the arg performs the evaluation (e.g. event.getArg('someOtherThing') GT 10
).
The redirect
command had two changes to syntax:
- The
persistArgIgnore
attribute was added which takes a list of event-args to ignore when persisting args across a redirect. This attribute is ignored whenpersistArgs
is defined. This is useful when you the list of args to persist is longer than the total of number of args you do not want to persist.
The CacheStats.cfc added a new method called getHitRatio
that gets the hit ratio of the cache strategy the stats belong to. The hit ratio is calculated by taking the total accesses (hits + misses) divided by hits. This produces a decimal product which when multiplied by 100 results in the percent that indicates the hit ratio.
getAppManager().getCacheManager().getCacheStrategyManager().getCacheStrategyByName("strategyName").getCacheStats().getHitRatio()
The getCacheStrategyByName
method added the checkParent
argument in order to bring the API of this manager inline with the remaining methods of this manager.