Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Mastering UML with Rational Rose 2002.pdf
Скачиваний:
137
Добавлен:
02.05.2014
Размер:
9.68 Mб
Скачать

Appendix: Getting Started with UML

Select the State Transition button from the toolbar.

2.

Drag from one state to another.

3.

Right−click the transition.

4.

Select Open Specification.

5.

Add transition details, such as an event or guard condition.

A transition indicates how an object can move from one state to another. It may include an event, which triggers the transition, or a guard condition. An event may also be sent to another object during the transition. A guard condition, which is enclosed in square brackets, controls when the transition may or may not occur. An action on the transition is a small piece of processing that occurs during the transition itself. The format for these items on a transition line is:

Event(Arguments) [Guard] /Action ^SendEventTarget.SendEvent(Arguments)

Building a Component Diagram

A Component diagram is used to model the physical components in your system: source code files, executable files, DLL files, ActiveX objects, and so on. Using a Component diagram, the team can specify what components exist and what their relationships are to each other.

This exercise is especially helpful in optimizing the design and planning for deployment. By mapping each component to its appropriate architectural layer (database, business logic, presentation, etc.), the team can see the interaction between the layers themselves. The team can analyze and optimize the communication between the layers before coding is complete.

Rose supports a number of different component stereotypes, such as the ones mentioned above.

To create a new Component diagram:

1.

Right−click a package in the Component view of the browser.

2.

Select New → Component Diagram.

3.

Name the new diagram.

699

Appendix: Getting Started with UML

A Component diagram is used to show a subset of the components or packages of components in the system and their relationships.

Follow these steps to add components to the model:

1.

Select the Component button from the toolbar.

2.

Click in the diagram to add the component.

3.

Name the component.

4.

Right−click the component.

5.

Select Open Specification.

6.

Set the component stereotype and language.

7.

Select the Realizes tab.

8.

Right−click each class that will be contained within the component, and select Assign. You may also drag the classes in the browser from the Logical view to the appropriate component in the Component view.

A component is one of the physical files that make up a system. Source code components will realize many of the various classes contained within the model.

700

Appendix: Getting Started with UML

Building a Deployment Diagram

Deployment diagrams illustrate the physical distribution of a system. A given project has one, and only one, Deployment diagram. These diagrams show the processors, devices, connections, and processes involved in the system.

Processors are machines on the network with processing power, including servers and workstations. They do not include printers and other such devices. Processors run processes (executable code).

Follow these steps to create the Deployment diagram:

1.

Double−click the Deployment view.

2.

Select the Processor toolbar button.

3.

Click the Deployment diagram to place the processor.

4.

Name the processor.

5.

Right−click on the processor and select New → Process from the menu.

6.

Name the process.

Devices are the other machines on the network. They include printers, scanners, dumb terminals, and backup devices.

701

Appendix: Getting Started with UML

To add devices to the diagram:

1.

Select the Device toolbar button.

2.

Click the Deployment diagram to place the device.

3.

Name the device.

Connections are physical links between processors and other processors, devices and other devices, or processors and devices. Connections can be physical network connections or virtual connections—across the Internet, for example.

To add connections to the diagram:

1.

Select the Connection toolbar button.

2.

Click on one processor or device to be connected.

3.

Drag the connection to the other processor or device to be connected.

4.

Name the connection.

702