- An Approach to Handling New Requirements
- The International E-Commerce System Case Study: Initial Requirements
- Handling New Requirements
- The Strategy Pattern
- Field Notes: Using the Strategy Pattern
- Summary
- Review Questions
The International E-Commerce System Case Study: Initial Requirements
In this new case study, I consider an order-processing system for an international e-commerce company in the United States. This system must be able to process sales orders in many different countries. In this chapter, I want to consider the challenges of changing requirements and ways to address them. In Chapter 16, I continue the case study, focusing on the problem of variations.
The general architecture of this system has a controller object that handles sales requests. It identifies when a sales order is being requested and hands the request off to a SalesOrder object to process the order.
The system looks something like Figure 9-1.
Figure 9-1 Sales order architecture for an e-commerce system.
The functions of SalesOrder include the following:
- Allow for filling out the order with a GUI
- Handle tax calculations
- Process the order, and print a sales receipt
Some of these functions are likely to be implemented with the help of other objects. For example, SalesOrder would not necessarily print itself; instead, it serves as a holder for information about sales orders. A particular SalesOrder object could call a SalesTicket object that prints the SalesOrder.