The Basics - Modeling a Logon Process
(Page 2 of 8 )
For the first short, get-up-to-speed-fast, hands-on example in this chapter, we’ve decided to model a process that many people create the code for during their career: a logon process. For the modeling of the logon process, you need VEA 2003. Basically, you model the class in Visio, and later you generate the code in VB .NET or C#. You can then include the generated output in a VS .NET project.
Creating the VB .NET Class Let’s get started with creating the class on the class diagram in our UML model. In Exercise 1-1, you will start a new UML diagram and add a class to it.
EXERCISE 1-1
- Open VEA.
- To create a new UML model, select File -> New -> Software -> UML Model Diagram. It doesn’t matter whether you select the UML Model Diagram (Metric) or the UML Model Diagram (US units). It’s only a matter of page settings and it has nothing to do with different models. Note that one of the two might not appear on your system, depending on what you selected during setup.
- Create a class by dragging the Class icon from the UML Static Structure tab in the Shapes window, usually located on the left side at the top. VEA should now look like Figure 1-1.
TIP The diagram view will probably be so small it will be hard to read when you first open it. However, you can change that by selecting a menu command in the View -> Zoom menu. There’s also a list box on the toolbar for this purpose.

Figure 1-1. VEA open with a new UML model diagram
You have the class diagram (static structure diagram) that you’ll be working with. Now it’s time to add attributes (variables and properties) and operations (procedures, event handlers, constructors, and destructors). You also need to give the class a name representing the functionality of the class. Exercise 1-2 shows how to do this.
EXERCISE 1-2
- Open the UML Class Properties dialog box by right-clicking the class (Class1) on the diagram and selecting Properties from the pop-up menu. You can also double-click the class.
- Name the class Logon by typing it in the Name text box, as shown in Figure 1-2.

Figure 1-2. The UML Class Properties dialog box
3. Select the Attributes category in the Categories list.
4. Create a new attribute by clicking the New button.
5. Type m_userID in the Attribute column.
6. Select VB::String from the Type list.
7. Repeat steps 4 through 6, giving the second new attribute the
name m_password. The UML Class Properties dialog box should
now look like Figure 1-3. Note that attributes are private by
default.
Figure 1-3. The UML Class Properties dialog box showing attributes
This article is excerpted from Enterprise Development with Visual Studio .NET, UML, and MSF by John Erik Hansen and Carsten Thomsen (Apress, 2004; ISBN 1590590422). Check it out at your favorite bookstore today. Buy this book now. |
Next: Coding Conventions >>
More .NET Articles
More By Apress Publishing