Skip to main content

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

AssociationMultiplicityMeaning
Store - Register1 to 1..*A store has one or more registers
Register - Sale1 to *A register records many sales over time
Sale - SalesLineItem1 to 1..*A sale has at least one line item
SalesLineItem - ProductSpecification* to 1Many lines refer to the same product
Sale - Payment1 to 1A sale is paid by one payment
Cashier - Sale1 to *A cashier handles many sales
Store - ProductSpecification1 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)

All Object Oriented Analysis and Design chapter 2 questions →