An operation is a function or transformation that can be applied to, or implemented by, the objects in a Class, Data Type or Interface. A Class, Data Type or Interface should have at least one Operation that performs a useful service to justify its existence. Operations:
• Describe the observable behavior of an object
• Apply to all members of the class
• Are defined once at the class level
• Are the visible interface to an internal method
• Can include optional parameters and/or return values.
Each operation must have a clearly defined signature consisting of the number and type of input arguments and return values.
Create an Operation in the following ways:
• Through the context menu of a Package or Model: right-click the item, point to New, point to UML, point to Behavior, and then click Operation.
• Through the context menu of a Class, Data Type or Interface: right-click the item, point to New, and then click Operation.
• Through the Operation button on the Class Diagram toolbar.
• Through the Items tab of a Class', Model's or Package's Property Pages.
An Operation message:
• Represents a signal between two objects
• Signals a request for a service
• Contains a signature which corresponds to the signature of an operation - a signature can include a name, optional parameters and optional return values.
On a Sequence Diagram, you can also add an instance of an Operation as a Reply Message.
You can create an Operation in the following ways:
• Through the context menu of a Class, Data Type, Interface, Model or Package.
• Through the Operation button on the Class Diagram toolbar
• Through the Items tab of a Class', Data Type's, Interface's, Model's or Package's Property Pages.
In addition, you can also create an Operation by copying an existing Operation. Modeler copies the Operation's links, child items and child diagrams. For more information, see
Copying items.
You can create a Return Type and Parameters for an Operation through its Signature. For more information, see
Using an operation signature to specify properties and parameters. If an Operation's signature is greater than 200,000 characters, the Parameters' Default values are not included in the signature.
When used on a Class Diagram, an Operation's notation is as follows:
Abstract Operations are shown in italic text:
If the Operation has Constraints applied to it, you can show the Constraints through the View Options of the owning Class, Data Type or Interface – select the Show Constraints check box.
For information about the View Options available for this symbol, click one of the links below:
When used on a General Flow Diagram, you can link an Operation to an Action or Frame, and then show the Operation's Parameters, Exceptions and Return Type as pins on the diagram.
When used on a Concurrency Diagram, Communication Diagram, or Sequence Diagram, an Operation Message's notation is as follows:
The following notation is used for the arrow:
The following notation is used to show instance properties of an Operation Message on a Concurrency Diagram:
The following notation is used to show instance properties of an Operation Message on a Sequence Diagram:
In the Modeler panes, a short-cut symbol on the Operation's icon indicates that the item is a
stub.
If you select the UML\Operations folder in the Dictionary pane, the Contents pane displays the following information about each Operation in the model: Name, Parent, Access, Binding, Abstract, Immutable, Changed By or Changed On.
You create overloaded operations by creating two or more Operations that have the same Name and the same parent. Although the Name of each overloaded Operation is the same, the signature of each overloaded Operation should be unique.
The following sections provide information about how an Operation is used in the model. For more information about a property, item, model part or diagram, click it.
Dependency —The Dependency is owned jointly by the Operation and the other associated item. The access permissions you have to a Dependency are determined by the access permissions of the dependent item.
Exception —The linked Exception specifies alternative courses of action if the Operation is not performed successfully. Exceptions contain a number of parameters, which are used to transmit or receive data from Operations.
Event Action Block —The linked Event Action Block uses the Operation as a Call trigger. You can make this link by dragging an Operation to an Event Action Block.
When an Operation uses an item as a data type, Modeler creates a special link between the Operation and the referenced item. You cannot navigate this link through the Links Editor.