VISIO implements UML

Source: Internet
Author: User

Http://www.qdgw.edu.cn/zhuantiweb/jpkc/2009/rjkf/xmwd/Visio_UmlModel.htm

UML Modeling with Visio

Content outline:

1. UML Modeling Environment in Visio
2. Use cases diagram (using case Diagram)
Composition of 2.1 use case diagrams
2.2 Creating a Use case diagram
2.2.1 To establish roles (Actor)
2.2.2 Build Use Cases
2.2.3 establish the communication of roles and use cases
2.2.4 establish the relationship between use cases
2.2.5 Build use case diagram
3, the establishment of activity diagram
3.1 Composition of the activity diagram
3.2 Creating an activity diagram
4. The use of static structure diagram (Diagram static Structure)
Composition of Class 4.1 static structure graphs
4.2 Creating a class static structure diagram
The establishment of 4.2.1 class
The establishment of the relationship between 4.2.2 classes
5. The establishment of sequence diagram (Sequence Diagram)
6, Visio and Ms. NET
6.1 Visio to generate. NET code
6.2 from. NET to build UML diagrams in Visio
Reference 1, UML modeling environment in Visio

The Microsoft Visio UML Model Diagram solution provides comprehensive support for creating object-oriented models of complex software systems. Includes the following tools, shapes, and features:

N "UML Model Explorer", which provides a tree view of the model and a means of browsing between views.
n Predefined smart shapes that represent elements in a UML annotation and support the creation of UML chart types. Under program control, these shapes operate in accordance with UML semantics.
n Easy access to the UML Properties dialog box, which allows you to add names, attributes, actions, and other properties to a UML element.
n Identify and diagnose errors (such as missing data or incorrectly using UML notation) for dynamic semantic error checking.
n the ability to reverse-engineer projects created with Microsoft Visual C + + 6.0 or Microsoft Visual Basic 6.0 to build a UML static structure model.
N uses C + +, Visual C #, or Microsoft visual Basic to generate a code framework based on class definitions in the UML model.
n identifies a language-specific error code-checking utility that causes code to not be compiled with the target language that you specify for the generated code.
n Create reports for UML static structures, activities, state diagrams, components, and deployment diagrams

Use of Model resource Manager

When you open the UML Model Diagram solution, you open a modeling environment and the model is in place from the start.

(Figure 1)

If the Model Explorer is not displayed, you can click the UML menu-> View-> Model Explorer

The tree view in the UML Model Explorer represents your overall system model. The chart that you create is a view of the model. Represents the system you are currently modeling. To add a model, on the UML menu, click Model. In this case, a model or abstract content of your system is represented as a static structure model. To rename any icon in the tree view, click the text of the icon once, and then click the text again. Type a new name. Represents the topmost package in a static structure model. A package is a container. This package contains all static structure model elements. By default, the new model includes packages that contain common data types. You can create a package that contains your own data type. Click the plus sign (+) to display the contents of the package. Click the minus sign to hide the contents of the package.

The steps to get the figure (1) are as follows:

A Change the default name of the topmost package to "PetShop": Right-click, select Rename

B Rename the package "static model" to "Design Model": Right-click, select Rename

C The other packages are named in turn

Back to the top of the page

2. Use cases diagram (using case Diagram)

Back to the top of the page

2.1 the composition of a use case diagram

A use case diagram represents the relationship between a participant and a use case in the same system. Is the description of a set of action sequences (including its derivative), which the system executes to produce an observable result value for the participant. Include three parts in Visio: Roles (ACTOR)

Represents the initiator of an activity, expressed in Visio. Use cases (uses case)

Real-world scenarios, such as landing systems, items entering warehouses, and Visio expressions. The system boundary indicates the boundary of the system use case to determine the boundary between the system's internal and external boundaries. Represented by a rectangular box.

Back to the top of the page
2.2 Create a use case diagram

Hypothesis (1), we have a warehouse system, there are three activities (use cases): the goods into the warehouse, the goods out of the warehouse and display the inventory of items. When out of the warehouse to check the inventory of goods, if the inventory is less than 5 can not be out of the warehouse. The performer of the activity is the warehouse administrator (these are from the requirements document), and the administrator needs to open the entry and exit list when entering or leaving the warehouse. This example we mainly consider the warehouse situation.

Back to the top of the page
2.2.1 to establish roles (Actor)

In Figure 1, select Actors Package, right-click, select Lead, enter name, as shown in Figure 2, Figure 3: Figure 2 Figure 3

Back to the top of the page
2.2.2 Build Use cases

Select "Usercases" in Figure 1, right-click, select Use case, enter "name", as shown in Figure 4, Figure 5: Figure 4 Figure 5

Back to the top of the page
2 . 2.3 establish the communication of roles and use cases

Represented in Visio as:

Back to the top of the page
2.2.4 Establish the relationship between use cases

A. Using relationships in a use case diagram, drag the use relationship shape onto the drawing page; Glue the use endpoint (without an arrowhead) to a connection point * on a use case shape that uses another use case, and glue the use endpoint (with arrows) to the connection point of the use case that you are using; double-click Use shape to open UML Inductive Properties dialog box. Add the property value, and then click OK.

B. Extending relationships in a use case diagram, drag an extension shape onto the drawing page; Attach the extension endpoint without an arrowhead + to the connection point + of the use case that provides the extension, glue the extension endpoint with an arrowhead to the connection point of the underlying use case, and double-click the extended shape to open the UML Generalization Properties dialog box. Add the property value, and then click OK.

Back to the top of the page

2.2.5 Build use case diagram

In Figure 1, select UseCase Model, right-click, and choose Use case diagram, where you leave the default name. You can then drag the roles and use cases that we've created from the left tree to the right margin. At the same time, we need to establish a system boundary, from the assumption (1) We know that the warehouse to check the inventory of goods, so the use case "cargo out" to use the use case "Display inventory" (There is no "show inventory" use case "cargo out of the warehouse" Use case is incomplete). And for use cases, "items in the warehouse," The warehouse administrator can also check the inventory of the items at the same time as they come in, so there is an extended relationship between them (the "cargo out" use case itself is fully functional, but the administrator can also view the inventory at some point), and the warehouse administrator can view the inventory information directly, The completed use case diagram is as follows: Figure 6

Note: For more information about creating a use case diagram, see the Visio online Help.
Back to the top of the page

3, the establishment of activity diagram

Back to the top of the page
3.1 An activity diagram's composition lane: Used to represent a responsibility in an activity diagram, a rectangle; state: Used to indicate an activity or action, divided into "action state", "state", "initial state", "final state"; Control flow: Represents a change from one state to another.
Back to the top of the page

3.2 Creating an activity diagram

Based on the assumption (1) We create an activity diagram of the items out of the warehouse, as follows: In Figure 1, select the package "Usecases", right-click the activity diagram, drag the lane to the right, and double-click the swim Lane to rename the "Item out". Drag the initial state from the left to the right margin to drag three action states to the right. Named "Request Out", "Select Warehouse" and "Judge inventory", then increase the control flow between the three, drag the "decision" process to the right, add two control flows, Double-click the control flow to enter a critical expression: success and failure; Drag the final state to the right. Connect two control flows in step 4.

The final results are as follows:

Note:1: The "merge" of the diagram (the third diamond from top to bottom) is the UML industry standard, and Visio does not support the icon for the time being. 2: For more information about creating an activity diagram, see the Visio online Help.
Back to the top of the page
4 , the use of static structure diagrams (Structure Diagram)

There are two static structure diagrams in Visio: The concept static structure diagram and the class static structure diagram. Conceptual static structure diagrams represent concepts in the real world and the relationships between them. It focuses on relationships and attributes rather than methods, and helps you understand the terminology in the domain of the system that you are developing.

A class static structure diagram is the decomposition of a software system into parts. In the class diagram, however, each section refers to a class that represents a fully defined software entity, rather than an object representing the concept of the real world. In addition to attributes and associations, class diagrams can also specify actions, methods, interfaces, and dependencies.

We highlight class static structure diagrams.

Back to the top of the page
composition of static structure diagram of 4.1 class

class static structure diagrams are composed of classes or objects, which are used in Visio to indicate that relationships between classes are primarily related, dependent, and summarized in three ways:

Association is the use of,, representing

Dependence is used to express

Inheritance (induction) is an expression of

Back to the top of the page
4.2 To create a class static structure diagram

Select "Staticview" in Figure 1, right-click to select "Static Structure Diagram", and drag from the right selection class icon to the right margin: Figure 8

Back to the top of the page
The establishment of 4.2.1 class

Drag the icon of the class from the left to the right. Enter the name, properties, and methods of the class: Figure 9 Figure 10 Figure 11

According to the Assumption (1), the warehouse system has the following classes:

Goodsoutput (out of order), Goodsoutputitem (out of stock), Storehouse (warehouse Class), Product (item Class), Manager (Warehouse manager Class), Storehousecontrol (Warehouse control Class), People (People Class), set up in sequence.

Back to the top of the page
4.2.2 class relationships between classes

  By analyzing we know that a warehouse can contain a lot of items, that is, the two are related (one-to-many). And the manager is inherited from people. Therefore, you can use the inherit graphic.

  Association relationship: Drag a two-dollar association shape from the UML static structure stencil to the drawing page next to the class you want to associate; Glue the endpoint of the associated shape to the connection point * of the class shape; double-click the association shape to open its UML Properties dialog box, Then enter or select the property value you want to set, and click OK.

  Inheritance relationship: Drag an inherited shape from the UML static structure stencil onto the drawing page next to the class or package that you want to associate. Glue the endpoint next to the arrow to the connection point * of the more common element. Glue an endpoint without an arrowhead to a connection point on a more specific element. Double-click the inductive shape. In the UML Generalization Properties dialog box, add the name, stereotype, discriminator, and other property values, and then click OK.

    static diagrams are as follows:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.