Section 3.7. Objects


3.7. Objects

Sometimes data objects are an important aspect of the process you're modeling. Suppose your company decides to sell the CMS as a commercial product, and you want to define a process for approving incoming orders. Each step in the order approval process will need information about the order, such as the payment information and transaction cost. This can be modeled in your activity diagram with an Order object, which contains the order information needed by the steps. Activity diagrams offer a variety of ways to model objects in your processes.

Objects don't have to be software objects. For example, in a non-automated computer assembly activity, an object node may be used to represent a physical work order that starts the process.


3.7.1. Showing Objects Passed Between Actions

In activity diagrams, you can use object nodes to show data flowing through an activity. An object node represents an object that is available at a particular point in the activity, and can be used to show that the object is used, created, or modified by any of its surrounding actions.

An object node is drawn with a rectangle, as shown in the order approval process in Figure 3-15. The Order object node draws attention to the fact that the Order object flows from the Receive Order Request action to the Approve Payment action.

Figure 3-15. The Order object node emphasizes that it is important data in this activity and shows which actions interact with it


See "Sending and Receiving Signals" for a more precise way of modeling the Receive Order Request actionas a receive signal node.

3.7.2. Showing Action Inputs and Outputs

Figure 3-16 shows a different perspective on the previous activity using pins . Pins show that an object is input to or output from an action.

An input pin means that the specified object is input to an action. An output pin means that the specified object is output from an action. In Figure 3-16, an Order object is input to the Approve Payment action and an Order object is output from the Receive Order Request action.

Figure 3-16. Pins in this change request approval process allow finer-grained specification of input and output parameters


Figures 3-15 and 3-16 show similar situations, but pins are good at emphasizing that an object is required input and output, whereas an object node simply means that the object is available at that particular point in the activity. However, object nodes have their own strength; they are good at emphasizing the flow of data through an activity.

If the Approve Payment action needs only parts of the Order objectnot the whole objectyou can use a transformation to show which parts are needed. Transformations allow you to show how the output from one action provides the input to another action.

Figure 3-17 specifies that the Approve Payment action requires the Cost object as input and shows how this data is obtained from the Order object using the transformation specified in a note.

Figure 3-17. Transformations show where input parameters come from


3.7.3. Showing How Objects Change State During an Activity

You can also show an object changing state as it flows through an activity. Figure 3-18 shows that the Order object's state is pending before Approve Payment and changes to approved afterward. The state is shown in brackets.

Figure 3-18. The focus of this diagram is the change of state of the Order object throughout the order approval process


3.7.4. Showing Input to and Output from an Activity

In addition to acting as inputs to and outputs from actions, object nodes can be inputs to and outputs from an activity. Activity inputs and outputs are drawn as object nodes straddling the boundary of the activity frame, as shown in Figure 3-19. This notation is useful for emphasizing that the entire activity requires input and provides output.

Figure 3-19 shows the Order object as input and output for the Approve Payment activity. When input and output parameters are shown, the initial node and activity final node are omitted from the activity.

Figure 3-19. Object nodes can be used to emphasize input to and output from an activity





Learning UML 2.0
Learning UML 2.0
ISBN: 0596009828
EAN: 2147483647
Year: 2007
Pages: 175

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