Chapter 2: Creating the Order Processing Application


Unified Modeling Language (UML) enables you to create component diagrams that model the physical system of an application. A component diagram consists of components , such as source code, binary code, dynamic-link library files, or executable. The component diagram also illustrates the dependencies between these components. You can use Visio to generate .NET skeleton code for an application based on the UML component diagram. You can then customize this skeleton code according to the requirements of the application.

This chapter demonstrates how you can use a UML component diagram that models the physical system of the Order Processing application to create the .NET skeleton code and then customize it.

Architecture of the Order Processing Application

Using the Order Processing application, a prospective customer can register, place an order for a product, and check the status of the order. The administrator of the Order Processing application updates the status of the orders and generates invoices for the completed orders.

The Order Processing application consists of an OrderProcessing project, which utilizes the classes that the UML component diagram creates. This project enables customers to register, select products, and place an order.

Figure 2-1 shows the architecture of the Order Processing application:

click to expand: this figure shows how different components of the order processing application such as the uml component diagram, the orderprocessing .net skeleton code, the orderprocessing project, and the orderprocessing database interact with each other.
Figure 2-1: The Order Processing Application Architecture

The ComponentDiagram.vsd file provides the component diagram for the Order Processing application. The component model in the ComponentDiagram.vsd file depicts the Customer, Invoice, and Order components and dependencies between them, as shown in Figure 2-2:

click to expand: this figure shows the customer, order, and invoice components and the dependencies between them in a component diagram.
Figure 2-2: The Component Diagram

For example, the arrows from the Invoice component to the Customer and Order components show that the Invoice component is dependent on the Customer and Order components because the administrator can generate invoices only after a customer places an order.

To create .NET skeleton code from ComponentDiagram.vsd file:

  1. Open Microsoft Visio.

  2. Open ComponentDiagram.vsd file.

  3. Select UML->Code->Generate option.

  4. Select the Target Language as Visual Basic

  5. Specify the Project Name as OrderProcessing

  6. Select the Template as Windows Application and Click OK.

The Customer component creates the .NET skeleton code for the Customers class. The Order component creates the .NET skeleton code for the Orders and OrderInformation classes. The Invoice component creates the .NET skeleton code for the Invoices and InvoiceCreditCardInfo class.

The OrderProcessing project consists of the following files:

  • Shared.vb : Provides the main() function that establishes a connection with the OrderProcessing database and invokes the Login Manager window to let customers and administrator log on to the Order Processing application.

  • frmLoginManager.vb : Provides the LoginManager class that defines the Login Manager window that customers and administrator use to log on to the Order Processing application.

  • frmApplicationManager.vb : Provides the ApplicationManager class that defines the Application Manger window that customers and administrator use to browse through the Order Processing application.

  • Customers.vb : Provides the Customers class that registers a new customer and retrieves information about a particular customer.

  • Orders.vb : Provides the Orders class to save the orders that a customer places, in the database. The Orders class also retrieves the status of an order, sorts information based on the status of an order, and updates the status of an order.

  • OrderInformation.vb : Provides the OrderInformation class that saves and retrieves product information for an order.

  • Invoices.vb : Provides the Invoices class that generates a new invoice and retrieves invoice information for an order.

  • InvoiceCreditCardInfo.vb : Provides the InvoiceCreditCardInfo class that saves the credit card information of a customer when the administrator generates the invoice for an order.

  • frmCustomerRegistration.vb : Provides the CustomerRegistration class that defines the Customer Registration window, where a customer provides information required for registration.

  • frmPlaceOrder.vb : Provides the PlaceOrder class that defines the Place Order window, where the customer can select products and place an order.

  • frmViewOrderStatus.vb : Provides the ViewOrderStatus class that defines the View Order Status window, where a customer views the status of an order after providing its order id.

  • frmViewOrderInfo.vb : Provides the ViewOrderInfo class that defines the View Order Information window, where a customer views the product information included in an order, such as the product name and the quantity ordered.

  • frmUpdateOrderStatus.vb : Provides the UpdateOrderStatus class that defines the Update Order Status window, where the administrator updates the status of an order after it is completed.

  • frmRaiseInvoice.vb : Provides the RaiseInvoice class that defines the Raise Invoice window, where the administrator views information on completed orders and raises invoices accordingly .

  • frmInvoice.vb : Provides the Invoice class that defines the Invoice window, where the administrator views information on the customer and order, and generates the invoice for that order.

Figure 2-3 shows the class diagram for the Order Processing application:

this figure shows the classes and the shared module in the order processing application.
Figure 2-3: The Class Diagram for the Order Processing Application



NET InstantCode. UML with Visio and Visual Studio .NET
NET InstantCode. UML with Visio and Visual Studio .NET
ISBN: N/A
EAN: N/A
Year: 2004
Pages: 49

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net