The Unified Modeling Language User Guide SECOND EDITION [Electronic resources]

Grady Booch, James Rumbaugh, Ivar Jacobson

نسخه متنی -صفحه : 215/ 149
نمايش فراداده

Common Modeling Techniques

Modeling Processors and Devices

Modeling the processors and devices that form the topology of a stand-alone, embedded, client/server, or distributed system is the most common use of nodes.

The UML's extensibility mechanisms are discussed in Chapter 6 .

Because all of the UML's extensibility mechanisms apply to nodes, you will often use stereotypes to specify new kinds of nodes that you can use to represent specific kinds of processors and devices. A

processor is a node that has processing capability, meaning that it can execute a artifact. A

device is a node that has no processing capability (at least, none that are modeled at this level of abstraction) and, in general, represents something that interfaces to the real world.

To model processors and devices,

  • Identify the computational elements of your system's deployment view and model each as a node.

  • If these elements represent generic processors and devices, then stereotype them as such. If they are kinds of processors and devices that are part of the vocabulary of your domain, then specify an appropriate stereotype with an icon for each.

  • As with class modeling, consider the attributes and operations that might apply to each node.

For example, Figure 27-5 takes the previous diagram and stereotypes each node. The server is a node stereotyped as a generic processor; the kiosk and the console are nodes stereotyped as special kinds of processors; and the RAID farm is a node stereotyped as a special kind of device.

Figure 27-5. Processors and Devices

Note

Nodes are probably the most stereotyped building block in the UML. When, as part of systems engineering, you model the deployment view of a software-intensive system, there's great value in providing visual cues that speak to your intended audience. If you are modeling a processor that's a common kind of computer, render it with an icon that looks like that computer. If you are modeling a common device, such as a cellular phone, fax, modem, or camera, render it with an icon that looks like that device.

Modeling the Distribution of Artifacts

When you model the topology of a system, it's often useful to visualize or specify the physical distribution of its artifacts across the processors and devices that make up the system.

The semantics of location are discussed in Chapter 24 .

To model the distribution of artifacts,

  • For each significant artifact in your system, allocate it to a given node.

  • Consider duplicate locations for artifacts. It's not uncommon for the same kind of artifact (such as specific executables and libraries) to reside on multiple nodes simultaneously.

  • Render this allocation in one of three ways.

    1. Don't make the allocation visible, but leave it as part of the backplane of your modelthat is, in each node's specification.

    2. Using dependency relationships, connect each node with the artifacts it deploys.

    3. List the artifacts deployed on a node in an additional compartment.

Using the third approach, Figure 27-6 takes the earlier diagrams and specifies the executable artifacts that reside on each node. This diagram is a bit different from the previous ones in that it is an object diagram, visualizing specific instances of each node. In this case, the RAID farm and kiosk instances are both anonymous and the other two instances are named (c for the console and s for the server). Each processor in this figure is rendered with an additional compartment showing the artifact it deploys. The server object is also rendered with its attributes (processorSpeed and memory) and their values visible. The deployment compartment can show a text list of artifact names, or it can show nested artifact symbols.

Figure 27-6. Modeling the Distribution of Artifacts

Instances are discussed in Chapter 13; object diagrams are discussed in Chapter 14 .