next up previous
Next: 3.3.3 Association actions Up: 3.3 Read and write Previous: 3.3.1 Object actions

3.3.2 Attribute actions

Attributes of objects can be read and written by attribute actions. The names of the attributes referred to are statically bound to the actions. This means that their names and order of appearance are specified in the model, and cannot be changed at run time. So for read actions, the only required parameter from the input pins is the object instance (or object identity). These actions read the specified attributes and put their values on the output pins. The order of the values is the same with the order of the attribute names given at model time. For write actions, they take an object instance and also new values as input, and modify the attributes accordingly. No output is produced.

Attributes may be sets or ordered sets; for example, a composition with a class whose multiplicity is 0..* in a class diagram. In both cases duplicated values in an attribute are not allowed. A read action reads all the values of an attribute, regardless of how many there are. However, it is possible to insert a value into an attribute with a write action. When the attribute is ordered, the insert action takes one more input as (run-time) position parameter; if the new value already exists in the attribute, it is moved to the new position. When the attribute is unordered, the position is omitted, and inserting a duplicated value to the attribute has no effect.

A special object ownerScope is a first class object. Such an object represents a classifier instead of an object instance. When a read/write action is carried out on it, the identity of the ownerScope object is not required from the input pins, because the target of the action is statically bound to the classifier.


next up previous
Next: 3.3.3 Association actions Up: 3.3 Read and write Previous: 3.3.1 Object actions
Thomas Feng 2003-04-18