- 2069 Poush · 6 marks
Point of sale class diagram
Short answer
A Store has 1..* Registers; each Register records many Sales. Each Sale consists of 1..* SalesLineItems pointing to a ProductSpecification. A Sale is paid by exactly 1 Payment. A Cashier handles many Sales. Composition: SalesLineItems are part of a Sale.
Draw a class diagram for point of sale system with association and multiplicity.
A Point of Sale (POS) system records sales and payments at a store checkout. The class diagram below is based on Larman's classic POS domain.
Assumptions: one store with several registers; one cashier handles each sale; each sale is paid by a single (cash) payment.
+-------+ 1 1..* +----------+
| Store |----------| Register |
+-------+ houses +----------+
| 1
| records
| *
+---------+ 1 * +-----------+ 1 1 +---------+
| Cashier |--------| Sale |-------| Payment |
+---------+handles |-----------| paid |---------|
| date,time | by | amount |
| total() | +---------+
+-----------+
| 1 (composition)
| 1..*
+-----------+
| SalesLine |
| Item |
| quantity |
+-----------+
| *
| 1
+-----------+
| Product | Store 1 ---- * ProductSpec
| Spec | (store stocks products)
+-----------+
Multiplicity table
| Association | Multiplicity | Meaning |
|---|---|---|
| Store - Register | 1 to 1..* | A store has one or more registers |
| Register - Sale | 1 to * | A register records many sales over time |
| Sale - SalesLineItem | 1 to 1..* | A sale has at least one line item |
| SalesLineItem - ProductSpecification | * to 1 | Many lines refer to the same product |
| Sale - Payment | 1 to 1 | A sale is paid by one payment |
| Cashier - Sale | 1 to * | A cashier handles many sales |
| Store - ProductSpecification | 1 to * | A store stocks many products |
Composition: Sale is composed of SalesLineItems (a line item cannot exist without its sale).
✓ Answer checked by Claude Opus 5.5 (high effort)
Related questions
- Event management system summary and class diagram · Object Oriented Analysis and Design, chapter 2
- Video rental shop class diagram · Object Oriented Analysis and Design, chapter 2
- XYZ Marina class diagram · Object Oriented Analysis and Design, chapter 2
- Deployment diagram as class diagram of nodes · Object Oriented Analysis and Design, chapter 3
- Health care center class diagram to code · Object Oriented Analysis and Design, chapter 4
- Marina class diagram implementation code · Object Oriented Analysis and Design, chapter 4
- Normalize sale relation up to 4NF · Database Management System, chapter 4
- ILD as system-specific; focal point recurrence · Theory of Structures II, chapter 4
- General block diagram of a control system · Control Systems, chapter 1
- Force-couple system about a point · Applied Mechanics, chapter 3
All Object Oriented Analysis and Design chapter 2 questions →