## Changing Attributes of a Mapping

Many classes of MappingMapping have attributes that provide values for parameter used within the transformation. For instance, the ZoomMapZoomMap class has an attribute called “ZoomZoom” that gives the scalar value by which each coordinate is to be multiplied. These attribute values should be set when the Mapping is created and should not be changed afterwards. Indeed, the AST library will report an error if an attempt is made to change the value of a Mapping attribute. This is because, once created, Mappings are often later included within other objects such as FrameSets and CmpMaps. This means that in general there could be many active references to a single Mapping object within a program. Changing an attribute of the Mapping via one particular reference (i.e pointer) would cause all the other references to change too, with often undesirable or unpredictable consequences. To avoid this, Mappings are considered immutable in most situations. The one exception is if the Mapping has not yet been cloned or included in another ObjectObject (i.e. it has a reference couint of one) - changing the attributes of such a Mapping is allowed, and will not generate an error.

Note, the InvertInvert attribute of a Mapping is not subject to this rule and can be changed at any time.