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.
2.
1
You can get a free version of Microsoft Visio 2003 from ELMS. Check http://www.cs.wayne.edu/~SWDist/ for more details.
(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
3.
It is similar how you added a class you can add association, aggregation, dependency, or inheritance relation between two classes.
4.
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