Introduction to VISIO 2007

Microsoft VISIO 2007 is installed in this lab as well as others on campus. VISIO will be used to design Universal Modeling Language (UML)class diagrams.

MSDN software, available to our students, offers you an opportunity to download the software to your own PC. The School of Business Administration has purchased a license that permits all our students to take advantage of a number of Microsoft products. If you have not received, you will shortly have an email from ELMS that will describe how to download VISIO 2007 and other current Microsoft products.

Starting Microsoft Visio 2007 will bring you to an opening screen. A sample opening screen appears on the right. The left-hand column is labeled Template Categories. This column contains folders of drawing templates for the many different types of diagrams Visio supports.

  • Move your cursor up and down to see the various building categories of tools.

  • Click on a category to view building tools associated with each category.

  • Select/highlight the Software and Database folder by clicking on the folder icon.

  • Double Click on the UML Model Diagram (US Tools). This is the second template on the right from the top of the screen.

The Visio Work area (see right hand column) is now available for you to begin a UML Class Model.

  • A brief review of the work area reveals the normal menu and icon bars at the top of the window. The window is dominated by a piece of graph paper which will receive your drawing. To the left of the graph paper are two small windows labeled Shapes and Model Explorer.

  • The Shapes window has the many drawing templates grouped by type of Diagram. We will primarily use the Class Diagrams embedded in the UML Static Structure. You can easily move between Shape categories by clicking on the grouping labels. The Model Explorer will reflect the actual work as you build or draw a diagram.

Begin drawing a Class Diagram by dragging a copy of the Class template to the graph paper (You may want to make the lower right hand "Model Explorer" smaller by dragging the top of the Model Explorer box down). The image on the graph paper will appear very small. The size may be changed by increasing the size of the font used. I recommend a 24pt font.

Notice that the Model Explorer now has a new component called Class 1 under the Static Model hierarchy. This refers to your model.

Rename the class to the class diagram you will be building. To rename the class:

  • Right Click the drawing surface.

  • A popup menu will appear with an arrow pointing to "class."

  • Scroll to the Properties Command and click on it.

  • In the dialog box that appears, enter the BankAccount, i.e. the class name.

  • Click OK

  • The name has been changed in both Model Explorer and on the actual drawing on the graph paper. You may click on the Print Preview icon at the top of the window to verify your changes. (use ZOOM IN icon to enlarge your crawing.

  • Close the Print Preview (or CTRL F2)to continue.

Adding or changing anything in the drawing is done through the Properties dialog box.

  • Right Click the drawing and choose the Properties dialogue box.

  • The left side of the box has a list of Categories of properties which may be increased in number or changed.

  • The current category should be pointing to Class.

Attributes: variables which are members of the class definition.

Operations: member functions or methods.

Select Attributes on the Properties dialog menu to add member variables to the Class model:

  • Click the New Button to activate one row in the spreadsheet.

  • Enter the Name of your first attribute, in the case of the tutorial, "balance." Be certain the spelling and case is entered as it appears in the class diagram shown on the right.

  • Tab to the Type column. This column contains a drop-down list of possible data types. The data types are grouped as being C++, C# and so forth. Because Microsoft's Java like language is C#, we will use it, adding categories if necessary.

  • From the drop-down list, select the data type of your first attribute or variable. This is balance and the type is "double."

  • Tab to the Visibility column. The drop-down list offers three choices-public, protected, or private. Select the visibility desired for your specific attribute. In the case of "balance," it will be private.

  • You have added the first attribute! Repeat these steps if you need to add other attributes to the Class Model. In the case of this example, there is only one variable, i.e. attribute.

  • Click OK to continue

Right click on your UML Model again and select "properties" as before.

Select Operations on the Properties dialog menu to begin adding the member methods to this Class model.

  • Click the New button. This activates one row in the spreadsheet.

  • Enter the name of the method with spelling and case as in the class definition shown on the BankAccount UML diagram.

  • Tab to the Return Type column. This column contains a drop-down list of possible return types for the function. The return types work as they do for attributes above.

  • Tab to the Visibility column. The drop-down list offers the same choices as for attributes. Select the correct visibility for the method, in the case of the Bank Account methods withdraw and deposit are void. The balance method returns a double value.

  • Repeat these few steps to add remaining methods to the Class model.

Some methods have formal parameters or arguments which must be doucmented on the class model. (Note that the first BankAccount lab does not contain parameters.)

  • After entering the function name, return type and visibility; click the Properties button.

  • This opens the Properties dialog box. Under Categories, click Parameters.

  • This opens a spreadsheet in which the first row is completed with the function name and its return type. To enter a parameter, click the New button.

  • Enter the name of the first parameter or argument.

  • Tab to the Type column. This column contains another drop-down list of possible data types for this argument. Select the correct data type for the argument.

  • Tab to the Kind column. This column allows you to specify if the argument is input to the function, output from the function, or both input and output. The designation allows you to identify if the arguments are call-by-value or call-by-reference.

  • Repeat the steps to add the remaining arguments to the function.

When you have completed adding all attributes and operations, click OK. Your work should be incorporated into the model. If you need to make corrections, simply right click the drawing and return to the Properties dialog box. You may print the drawing from the Print Page icon or the File menu.

Be Certain to place your NAME on the drawing. Use the Text Tool on the VISIO Toolbar.

    Although you will not add other data types for this exercise, you will in future drawings. To add a data type not included in the C# types:

    • On the main Visio window, find the Model Explorer window.

    • Right Click on the C# Data Type folder.

    • A pop-up menu will appear. Click New

    • Click Datatype and a dialog box, UML Datatype Properties will open.

    • Enter the name of the data type desired and click OK.This data type will then be available for use while adding or changing attributes and/or operations.