7.1 Object and Attribute Actions


Definition: An action is an individual operation that performs a single task on an element of a model.

When we write object actions, we write the action for an arbitrary object. The target of the action is specified at run time, and is generally held in an object reference variable.

Definition: An object reference is a value that refers to an object.

An object reference is not the object itself.

Figure 7.1 lists syntax for several object and attribute actions, and several examples are shown in Figure 7.2.

Figure 7.1. Syntax for Several Object and Attribute Actions

graphics/07fig01.gif

Figure 7.2. Examples of Object and Attribute Actions

graphics/07fig02.gif

In the first line, the object reference newPublisher refers to the newly created Publisher object.

The second line sets the attribute name to "Addison-Wesley" and the next line reads that attribute and places the result in a variable x.

The last line deletes the newly created object.

In the course of this book we will use the action language a great deal, so you will see a plethora of examples, including many extensions to the basic syntactic elements described in this chapter. No need to get carried away here.



Executable UML. A Foundation for Model-Driven Architecture
Executable UML: A Foundation for Model-Driven Architecture
ISBN: 0201748045
EAN: 2147483647
Year: 2001
Pages: 161

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net