Examining the UML Models: Static Models - Nodes
(Page 11 of 13 )
Nodes in deployment diagrams represent hardware components capable of executing software code. The notation of a node is a shaded, three-dimensional box. You can choose between two types of node elements:
- The node element, which represents a specific type of node, for example, a server
- The node instance element, which represents an instance of a node type
In Exercise 5-20, you’ll create a deployment diagram and add a node element and a node instance element.
EXERCISE 5-20
- Open VEA, if it is not already open.
- Create a deployment diagram named MyDeploymentDiagram.
- Add a node named Server to the diagram.
- Add a node instance named Web Server Alpha to the diagram. Your deployment diagram should look like Figure 5-36.
As you can see in Figure 5-36, the node named Web Server Alpha is a node instance element and, as such, an instance of the Server node.
NOTE In the Model Explorer, you can see only node elements, not node instance elements. This is because node instance elements are simply instances of other node elements.
Components You can add components to your deployment diagram to specify on which servers the components will be physically running. As is the case with nodes, there are two kinds of components:
- The component element represents a physical component.
- The component instance element represents a runtime instance of a physical component.
You can document on which server (node) the components will be running by applying them to the specific node.
In Exercise 5-21, you’ll add two components to your deployment diagram: Customer and Discount (see Figure 5-35).
EXERCISE 5-21
- On MyDeploymentDiagram, add a component named Customer.
- Add a component named Discount to the diagram.
- Double-click the Customer component to open the UML Component Properties dialog box.
- Select the Nodes category.
- Select the Server node. The UML Component Properties dialog box should now look like Figure 5-37.

Figure 5-37. UML Component Properties dialog box
6. Click OK.
In the exercise, you used the UML Component Properties dialog box to specify on which node the Customer component would run. Another way to do this is through the UML Node Properties dialog box. Double-click the node on which the component is running and select the Components category, as shown in Figure 5-38.

Figure 5-38. UML Node Properties dialog box
Relationships
Deployment diagrams have two basic relationship types:
Communicates: The communicates relationship is for specifying how two elements communicate with each other. In Figure 5-36, you can see a communicates relationship between the two node elements. This indicates that the two nodes are communicating with each other. Actually, when placing a communicates relationship between two nodes (which represent hardware components, remember?), it usually means that the two nodes are connected in some way. That’s why we’ve made the example of a server connected to an overhead projector (for example, using USB). Figure 5-36 also shows a communicates relationship between the Server component and the Customer component, illustrating that the component is installed on the server and is processed there.
Dependency: The dependency relationship specifies a dependency between two elements. In Figure 5-36, the Customer component is dependent on the Discount component, and therefore affected by its availability or by changes to its functionality. You can use the dependency relationship freely to specify important issues, helpful for your implementation. For example, in Figure 5-36, we’ve added a dependency relationship between the Server node and the Web Server Alpha node instance to indicate that the server implementation will take place on the server named Web Server Alpha.
In Exercise 5-22, you’ll add relationships to your deployment diagram.
EXERCISE 5-22
- On MyDeploymentDiagram, add a communicates relationship between the Server and Overhead Projector nodes.
- Right-click the relationship and select Shape Display Options from the pop-up menu to show the Shape Display Options dialog box.
- Deselect the following options: First end name, Second end name, and End multiplicities. Then click OK.
- Add a communicates relationship between the Server node and the Customer component.
- Right-click the relationship and select Shape Display Options from the pop-up menu to show the Shape Display Options dialog box.
- Deselect the First end name, Second end name, and End multiplicities options. Then click OK.
- Add a dependency relationship between the Server node and Web Server Alpha node instance.
- Add a dependency relationship between the Customer and Discount components. MyDeploymentDiagram should now look like Figure 5-36.
Next: Stereotypes >>
More .NET Articles
More By Apress Publishing
|
This article is excerpted from Enterprise Development with Visual Studio .NET, UML, and MSF written by John Erik Hansen and Carsten Thomsen (Apress, 2004; ISBN: 1590590422) Buy this book now.
|
|