concept OrderIT in category .net

appears as: OrderIT
Entity Framework 4 in Action

This is an excerpt from Manning's book Entity Framework 4 in Action.

Figure 2.6. The design of OrderIT

Many books have a running example, and this one is no exception. We’ll use a classic order application called OrderIT that manages products, orders, customers, and so on. Here’s the list of the requirements:

  • OrderIT must store data about customers. Each customer has a name, billing address, and shipping address. The address isn’t plain text but consists of four separate pieces of data: street, city, ZIP code, and country. What’s more, customers can access a web service to place or update orders, so they’ll need a user-name and password to access the web service.
  • OrderIT must store data about suppliers. Each supplier has a name, an International Bank Account Number (IBAN), and payment terms (the number of days the customer has to pay the invoice).
  • OrderIT must store data about products. The system must be able to sell any product, from shoes to T-shirts, from a computer mouse to a table-tennis paddle, and so on. The application must be ready to accept new types of products with a minimal effort and with no impact on the previous products and related orders.
  • OrderIT must track the number of items currently in stock. Every time an item is sold or bought, the inventory quantity must be updated. The user must also be able to add new items to the current quantity.
  • OrderIT must be able to store whatever products are sold by the suppliers. A single supplier can sell many products, and a single product can be bought from many suppliers.
  • OrderIT must manage any incoming orders from customers. Every order must store data about the customer who made it and give that customer the option to use a shipping address different from the one held in the database. A customer can buy many products at once, so an order can contain multiple details.
  • OrderIT must calculate the applicable discount. The policy for discounts states that if the customer buys more than five of the same product, there is a discount of 10 percent for each subsequent item. Should the discount be applicable, the order must contain two details: the first contains data about the first five items with no discount, and the other contains data about the additional items and the related discount.
  • OrderIT must allow the user to change the price of items easily and quickly. Sometimes the user needs to change the price of one product, and other times prices need to be updated based on some characteristic (such as the type of product or the brand).
  • OrderIT must allow the customer to retrieve and modify account details and orders. OrderIT exposes a web service that customers can use to place, modify, or delete orders. Customers can modify their own account details too.