This is an archived version of the course. Please find the latest version of the course on the main webpage.

Week 4 Live Lecture Task

Chapter : Week 4 Live Lecture Task

Online shopping app

face Josiah Wang

You are asked to work on the following task in small groups during the Live Lecture in Week 4.

Below is a specification for a scenario where you are designing an online shopping app for a client. Your task is to design the necessary classes to build this online shopping app.

Identify what classes might be needed for your app, and then try to model the relationship between the classes. It is sufficient to use class diagrams for this (no Python code needed!)

Just focus on “modelling” the classes - there is NO NEED to implement the whole workflow (like logging in, retrieving shopping carts, shipping, dispatching, etc.) I am only expecting your classes to be able to accommodate these when implemented!

Scenario

  • You are developing an online shopping app for a client.
  • The client sells many different products. The products might be sold at a price that might change at any point (sales!) The client would like to be able to also show the original list price alongside the current sale price (you know, to entice customers)!
  • Each customer will be assigned their own shopping cart. Customers should be able to retrieve the content of their shopping cart (the products and quantity) when they log in from any computer. They can add and delete products or update the quantities at any point until they check out.
  • Upon checking out, the system will create a new order with an initial “confirmed” state. For simplicity, you can assume that all payment has automatically been cleared when the customer checks out
  • When the order has been prepared (the “ready for dispatch” state), it will generate a shipment with an initial estimated shipment date and an estimated arrival date. Once the order has been dispatched, the system should update the shipment date and estimated arrival date and set the order status to “dispatched”.

Start by identifying any nouns in the specifications and decide whether they should be part of your classes.