Why immutable locators are essential

Release 1.3 - ...

The immutableLocators setting was introduced in 1.3. It is an optional but highly recommended Release Setting in the Smartsite.config:

XML CopyCode image Copy Code
<runtime>
    <releaseSettings>
         <add key="immutableLocators" value="true"/>
         (...)
    </releaseSettings>
    (...)

Highly recommended

Without the immutableLocators setting, you might run into very subtle bugs in your SXML code, because Viper methods such as Url.AddParameter(), that returned modified versions of locators, also changed the input locators passed as arguments to the viper methods. This is of course counterintuitive and undesirable.

Code check

Note that setting immutableLocators will impact the way you write SXML, as only the return value of your calls to viper methods manipulating locators will be affected.

When passing a locator buffer to such method, the buffer will no longer be affected, and you might have to rewrite the SXML:

{buffer.set(url, HOME)}
{url.setparameter($url, "x", 1)}
{url.setparameter($url, "y", 1)}
{buffer.get(url)}

... will have to be rewritten as...

{buffer.set(url, HOME)}
{buffer.set(url, url.setparameter($url, "x", 1))}
{buffer.set(url, url.setparameter($url, "y", 2))}
{buffer.get(url)}

URL Parameters

As we move on with Smartsite iXperion, we have decided that the immutableLocators setting is crucial to effective and predictable site building. This is why in iXperion 1.4, the URL parameters feature, used to store querystring variables inside the path segment of a friendly URL, is only available if the release setting 'immutableLocators' is set.