Question: Determine the classes needed for an order tracking system with the following specifications:
Customers can place one order for any number of products. Every product has a product number, product description and price. A customer can order more than one product at once (in one order). When a customer orders two products in one order, and product 1 is in stock and product 2 is not, then we ship first product 1, and later ship product 2. We need to keep track of the status of ever order, and shipping date of every product. At this moment we make a distinction between corporate customers and personal customers. For all customers, we keep track of their credit rating. Corporate customers can have excellent, good, or poor credit rating. Personal customers have by default a poor credit rating. If the credit rating is poor, then the order must be prepaid before we send out the product. This means that all orders from personal customers must be prepaid by credit card. If the credit rating is not poor, then the order does not need to be prepaid. Every corporate customers also has a certain credit limit. If the total order price is higher than the credit limit, the order must be prepaid. The system will generate a monthly bill for all corporate customers who did not
prepay their order(s).
When a customer buys a lot of products at our store, we want to reward that customer with a certain discount. If customers buys a computer -related product, then they get two points for every computer-related product they buy. For every heath-related product, they get one point, and for every audio/video related product, they get 1/2 point. For all other products, they get 1/4 point. If customers accumulate 25 points, they get 40% discount on their next order. If they receive this discount, then their number of points is reset to zero.
Although i have to determine only classes but i have made the UML diagram so you can separate the classes as per your requirements:
Following are the classes that I have found appropriate:
- A Customer
- Computer Points
- Audio Video Points
- Health Points
- Other Points
The product should be in class because it is to be ordered by the customer and each product has some points.
A customer should be class because customers are the one who orders the products and they differentiate into two more customer corporate customer and personal customer.
Each corporate customer and the personal customer has their own characteristics so they must be made another class.
Customer orders products so we need to make one class for each order.
Each product has points assigned as per products. So there will be points class and it’s subclasses will be computer points, audio video points, health points, and other points