You are on page 1of 5

Microsoft Office Visio tutorial

1.

Starting Visio1

Start Visio 2003 or 2007. You need to choose the drawing type. Select Software folder, choose UML-model diagram icon and UML Static Structure Diagram (Figure 1). Place the mouse over the shapes in UML Static Structure Diagram to view more details. Change the page orientation to landscape from file->page setup to have more drawing space.

Figure 1. Select UML Static Structure Diagram

2.
1

Add a class to your diagram

You can get a free version of Microsoft Visio 2003 from ELMS. Check http://www.cs.wayne.edu/~SWDist/ for more details.

Click on the Class shape and drag it on the page

(Figure

2)
You can change the name of the class. Right click on the shape and a Class Properties window will appear. You can change its name from the name field. You can add attributes for the class by clicking Attributes in the right of Class Properties window. You can set the class and see the advanced option for each attribute (Figure 3). You can choose predefined types that are from C++ or from existing data types that you add it to the diagram

Figure 2. Add a new class

Figure 3. Select the properties of the attributes

3.

Add a relation to your diagram

It is similar how you added a class you can add association, aggregation, dependency, or inheritance relation between two classes.

3.1. Add and association


Double click on the association to specify it. You can give the association a name and/or enter role names in the column "End Name" (when this option is marked in the Shape Display Options). Make sure you change the display options so that the name of the association is displayed (Figure 4).

Figure 4. Show/hide details of the association

4.

Save the diagram

You can save the diagram in different formats. In this class, you are required to save in drawing format (vsd). You can also select the figures and paste them into a doc file.

5. Exercise
Create a UML class diagram that has 3 classes: Inventory, Store, Item, similar to the one in Figure 5. Draw all the attributes and methods for the 3 classes. Extend the diagram to the one in Figure 6. 1) Add the classes Price and PromoPrice, where PromoPrice extends the class Price. 2) Change the type of the price attribute in the class Item to Price and draw an association line between Item and Price

3) In the class Item add two methods: Price getPrice():Price and void setPrice(double p). 4) Mark with red the names of the class Item, Price, and PromoPrice to show that they were changed

Figure 5. Sample of a UML class diagram

Figure 6. Extended UML class diagram


Tips: for your project use Class View in Visual Studio to view the classes, the methods and the attributes. You can copy and paste the diagram from Visio into Microsoft Word, and you can modify it from Microsoft Word The fewer lines intersect in the diagram the more clear the diagram is

You might also like