Free Programming Books
Free download ebooks on computer and programming

Free Ebook "Beginning Object-Oriented Programming with VB 2005: From Novice to Professional" Sample Chapter

Beginning OOP with VB 2005..
Free Download Chapter 4: Designing OOP Solutions:A Case Study
Download chapter

Beginning Object-Oriented Programming with VB 2005 is a comprehensive resource of correct coding procedures. Author Daniel Clark takes you through all the stages of a programming project, including analysis, modeling, and development, all using object-oriented programming techniques and VB .NET.

Clark explores the structure of classes and their hierarchies, as well as inheritance and interfaces. He also introduces the .NET Framework and the Visual Studio integrated development environment, or IDE. A real-world case study walks you through the design of a solution. You can then transform the design into a functional VB .NET application.

The application includes a graphical user interface (GUI), a business logic class library, and integration with a back-end database. Throughout the book, you'll explore the fundamentals of software design, object-oriented programming, Visual Basic .NET 2.0, and the Unified Modeling Language (UML).

< < prev next > >

Designing OOP Solutions: A Case Study

Designing solutions for an application is not an easy endeavor. Becoming an accomplished designer takes time and a conscious effort, which explains why many developers avoid it like the plague. You can study all the theories and know all the buzzwords, but the only way to truly develop your modeling skills is to roll up your sleeves, get your hands dirty, and start modeling. In this chapter, you will go through the process of modeling an office-supply ordering system. Although this is not a terribly complex application, it will serve to help solidify the modeling concepts covered in the previous chapters. By analyzing the case study, you will also gain a better understanding of how a model is developed and how the pieces fit together.

After reading this chapter, you should be familiar with the following:

  • How to model an OOP solution using UML tools
  • Some common OOP design pitfalls to avoid

Developing an OOP Solution

In the case-study scenario, your company currently has no standard way for departments to order office supplies. Each department separately implements its own ordering process. As a result, it is next to impossible to track company-wide spending on supplies, which impacts the ability to forecast budgeting and identify abuses. Another problem with the current system is that it does not allow for a single contact person who could negotiate better deals with the various vendors.

As a result, you have been asked to help develop a company-wide office-supply ordering (OSO) application. To model this system you will complete the following steps:

  • Create an SRS.
  • Develop the use cases.
  • Diagram the use cases.
  • Model the classes.
  • Model the user interface design.

Creating the System Requirement Specification

After interviewing the various clients of the proposed system, you develop the SRS. Remember from Chapter 2 that the SRS scopes the system requirements, defines the system boundaries, and identifies the users of the system.

You have identified the following system users:

  • Purchaser: Initiates a request for supplies
  • Department manager: Tracks and approves supply requests from department purchasers
  • Supply vendor processing application: Receives XML order files generated by the system
  • Purchase manager: Updates supply catalog, tracks supply requests, and checks in delivered items
You have identified the following system requirements:
  • Users must log in to the system by supplying a username and password.
  • Purchasers will view a list of supplies that are available to be ordered.
  • Purchasers will be able to filter the list of supplies by category.
  • Purchasers can request multiple supplies in a single purchase request.
  • A department manager can request general supplies for the department.
  • Department managers must approve or deny supply requests for their department at the end of each week.
  • If department managers deny a request, they must supply a short explanation outlining the reason for the denial.
  • Department managers must track spending within their departments and ensure there are sufficient funds for approved supply requests.
  • A purchase manager maintains the supply catalog and ensures it is accurate and up to date.
  • A purchase manager checks in the supplies when they are received and organizes the supplies for distribution.
  • Supply requests that have been requested but not approved are marked with a status of pending.
  • Supply requests that have been approved are marked with a status of approved and an order is generated.
  • Once an order is generated, an XML document containing the order details is placed in an order queue. Once the order has been placed in the queue, it is marked with a status of placed.
  • A separate supply vendor processing application will retrieve the order XML files from the queue, parse the documents, and distribute the line items to the appropriate vendor queues. The vendor will retrieve the order XML documents from the queue.
  • When all the items of an order are checked in, the order is marked with a status of fulfilled and the purchaser is informed that the order is ready for pickup.