Skip to content

Mach II 1.6 Changes During Beta Release

thofrey edited this page Apr 1, 2014 · 4 revisions

Table of Contents

  1. A Reference for Current Mach-II Developers
  2. Who Should Use This Document
  3. Change Overview

A Reference for Current Mach-II Developers

This is a working document and may not reflect the latest commits to the repository.

Who Should Use This Document

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.

Change Overview

XML Syntax Changes or Additions

Cache Command

The cache command had two changes to the syntax:

  • The attribute alias was changed to aliases. 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 to strategyName. The old attribute was confusing as it refers to the caching strategy name to use for the cache block. The attribute name in the cache command was changed to strategyName. 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" />

Cache-Clear Command

The cache-clear command had three changes to the syntax:

  • The attribute id was changed to ids. 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 to aliases. 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 to strategyNames. 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 uses event and properties 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).

Redirect Command

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 when persistArgs 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.

API Changes or Additions

CacheStats.cfc

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()

CacheStrategyManager.cfc

The getCacheStrategyByName method added the checkParent argument in order to bring the API of this manager inline with the remaining methods of this manager.

Clone this wiki locally