Presentation is loading. Please wait.

Presentation is loading. Please wait.

Mail Order.

Similar presentations


Presentation on theme: "Mail Order."— Presentation transcript:

1 Mail Order

2 Requirements An employee takes orders from customers
Each purchase may contain multiple products System maintains customer information System maintains product information

3 Use Cases Add/delete/update/view customers
Add/delete/update/view products Take purchase orders View purchase orders Delete purchase orders Update purchase orders

4 The Database - ERD Name Address Name Description Id Id Product
Customer M 1 Price contains Places Quantity N N Purchase Order Order_date PO Id

5 The Database - Schema customer customer_id name address purchase_order
po_id Customer_id order_date order_item id po_id product_id quantity product product_id name description price

6 System Architecture Database Take purchase order Delete purchase order
OrderManagement Take purchase order Delete purchase order Update purchase order View purchase order CustomerManagement ProductManagement Add customer Delete customer Update customer View customer Add product Delete product Update product View product Database

7 System Architecture Each package is responsible for CRUD on a set of tightly related business entities E.g., Customers, customer groups (VIP, etc), and customer credit card info as a package Use cases are allocated to packages and each package contains related use cases E.g., Add customer including his group and credit card info, update customer, delete customer, and query customer in CustomerManagemant Each package has a Manager which takes cares of the business logic of the use cases. E.g., OrderManager would check if an order contains more than the limit of the number of items or not. A Design Pattern called Service Layer may be used to package managers’ operations as one class – ServiceLayer MailOrder sample app employs this approach.

8 System Architecture Each use case is mapped to a Presenter which is responsible for the presentation logic of the use case. E.g., TakeOrderPresenter is responsible for creating a new purchase order and saving the order in the DB Each Presenter may employ multiple Views each of which is a UI. E.g., TakeOrderPresenter uses SelectCustomerView to select a customer for the order, SelectOrderItemsView to collect order items, finally ConfirmOrderView to display the order info to the user.

9 System Architecture Database entity OrderManagement Customer Product
PuchaseOrder OrderItem ui SelectCustomerView SelectOrderItemsView ConfirmOrderView TakeOrderPresenter db CustomerDao ProductDao PuchaseOrderDao OrderItemDao MailOrderDatabase ViewOrderPresenter PurchaseOrderManager Depends on A B Database

10 Architecture – Service Layer
OrderManagement CustomerManagement ui SelectCustomerView ConfirmOrderView ProductManagement TakeOrderPresenter ViewOrderPresenter server ServiceLayer (Façade) db CustomerDao PurchaseOrderDao OrderItemDao ProductDao MailOrderDatabase Database

11 Detailed Design: db & entity
Customer Product Purchase Order Order Item Customer_id Name Address Product_id Name Description Price Po_id Customer_id Order_date Po_id Product_id Quantity CustomerDao ProductDao PurchaseOrderDao OrderItemDao Insert() Delete() Update() getCustomerById() getAllCustomers() Insert() Delete() Update() getProductById() getAllProducts() Insert() Delete() Update() getPOById() getAllPOs() Insert() Delete() Update() getItemByItemId() getItemsByOrderId() MailOrderDatabase getConnection() Close()

12 Detailed Design: OrderManagement
ui 1. Customers = ServiceLayer#getAllCustomers(); 2. Display SelectCustomerView(customers) 3. products = ServiceLayer#getAllProducts() 4. Display SelectOrderItemsView(products) 5. Display ConfirmOrderView() SelectCustomerView SelectOrderItemsView ConfirmOrderView TakeOrderPresenter begin() ServiceLayer getAllCustomers() AllProducts() CustomerDao.getAllCustomers() ProductDao.getAllProducts() db CustomerDao ProductDao PuchaseOrderDao OrderItemDao MailOrderDatabase Code segment

13 Detailed Design: Startup
AppController Main() HomeView.instance().display() OrderManagement HomeView Display() Start Take Order use case TakeOrderPresenter Start ViewOrder use case ViewOrderPresenter CustomerManagement AppContext Static getInstance() getDbConnection() ProductManagement


Download ppt "Mail Order."

Similar presentations


Ads by Google