NET InstantCode. UML with Visio and Visual Studio .NET

A Unified Modeling Language (UML) static structure diagram depicts a software system decomposed into subsystems in the form of classes, interfaces, and packages. The classes and interfaces in a static structure diagram map to source files in the .NET framework, whereas packages map to namespaces in the .NET framework.

This chapter describes the UML static structure diagram that models the Online Book Store application in terms of classes and packages. It explains how the Online Book Store application utilizes the classes that Microsoft Visio creates from a UML static structure diagram to provide functions for an end user to log on, select books, and place an order.

Architecture of the Online Book Store Application

The Online Book Store application consists of two projects:

The OnlineBookStore project constitutes the Online Book Store Web application, which enables an end user to browse for books online, add books to a shopping cart, and place an order for the books in the cart.

The BookStoreAdministrator project constitutes the Book Store Administrator application, which enables the administrator of the application to add and update information about the books available for sale. The BookStoreAdministrator project also enables the administrator to view and update the orders that customers place using the Online Book Store Web application.

Figure 3-1 shows the architecture of the Online Book Store application:

Figure 3-1: The Online Book Store Application Architecture

The OnlineBookStoreUMLModel.vsd file provides the UML static structure diagram for the Online Book Store application. The UML static structure diagram in the OnlineBookStoreUMLModel.vsd file shows the OnlineBookStore package and the ViewCart, BookStore, CustomerInfo, Login, BookObject, PlaceOrder, and ShowMessage classes in that package, as shown in Figure 3-2:

Figure 3-2: The UML Static Structure Diagram

These classes provide the .NET skeleton code, which you need to customize according to the requirements of the Online Book Store application. To create .NET skeleton code from OnlineBookStoreUMLModel.vsd file:

  1. Open Microsoft Visio.

  2. Open OnlineBookStoreUMLModel.vsd file.

  3. Select UML->Code->Generate.

  4. Select the Target Language as Visual Basic.

  5. Specify the Project Name as OnlineBookStore.

  6. Select the Template as ASP.NET Web Application and Click OK.

The OnlineBookStore project consists of the following files:

The BookStoreAdministrator project consists of the following files:

Figure 3-3 shows the class diagram for the Online Book Store application:

Figure 3-3: The Class Diagram for the Online Book Store Application

Категории