---
title: "Point of sale class diagram"
subject: "Object Oriented Analysis and Design"
chapter: 2
key: "semester_6/object_oriented_analysis_and_design:pos-class-diagram-multiplicity"
source: https://www.bctengineer.com/q/semester_6/object_oriented_analysis_and_design/pos-class-diagram-multiplicity
site: BCT Engineering
---

# Point of sale class diagram

Object Oriented Analysis and Design · Chapter 2: Object Oriented Analysis

- Asked in: 2069 Poush, 6 marks
- Video: [UML class diagrams](https://www.youtube.com/watch?v=6XrL5jXmTwM) — Lucid Software
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_6/object_oriented_analysis_and_design/pos-class-diagram-multiplicity
- Whole chapter: https://www.bctengineer.com/md/semester_6/object_oriented_analysis_and_design/chapter-2

## Question

Draw a class diagram for point of sale system with association and multiplicity.

## 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.

## Answer

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.

```text
+-------+ 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 `SalesLineItem`s (a line item cannot exist without its sale).

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. In the POS diagram, what is the Store to Register multiplicity?
   A. 1 to 1..*
   B. 0..1 to *
   C. * to 1
   D. 1 to 1
   Answer: A. A store houses one or more registers. (Key point: Store-Register multiplicity)

2. Sale and SalesLineItem are related as:
   A. Sale inherits from SalesLineItem
   B. Each sale has exactly one line item
   C. Sale composes 1..* line items; a line item cannot exist without the sale
   D. Line items are independent of any sale
   Answer: C. Composition: the part's life depends on the whole, and a sale has at least one line. (Key point: Sale-SalesLineItem)

3. Why is SalesLineItem to ProductSpecification many-to-one?
   A. Each product can be sold only once
   B. A line holds many products
   C. A product has many stores
   D. Many lines can refer to the same product
   Answer: D. Many line items across sales may refer to the same product specification. (Key point: SalesLineItem-ProductSpecification)

4. Under the stated assumption, Sale to Payment is:
   A. * to *
   B. 0..1 to *
   C. 1 to 1
   D. 1 to *
   Answer: C. Each sale is paid by one (cash) payment. (Key point: Sale-Payment)

## Related in Object Oriented Analysis and Design

- [Event management system summary and class diagram](https://www.bctengineer.com/question.md?key=semester_6%2Fobject_oriented_analysis_and_design%3Aoems-executive-summary-class-diagram) — Object Oriented Analysis and Design, chapter 2
- [Video rental shop class diagram](https://www.bctengineer.com/question.md?key=semester_6%2Fobject_oriented_analysis_and_design%3Avideo-rental-class-diagram) — Object Oriented Analysis and Design, chapter 2
- [XYZ Marina class diagram](https://www.bctengineer.com/question.md?key=semester_6%2Fobject_oriented_analysis_and_design%3Amarina-class-diagram) — Object Oriented Analysis and Design, chapter 2
- [Deployment diagram as class diagram of nodes](https://www.bctengineer.com/question.md?key=semester_6%2Fobject_oriented_analysis_and_design%3Adeployment-diagram-special-class-diagram) — Object Oriented Analysis and Design, chapter 3
- [Health care center class diagram to code](https://www.bctengineer.com/question.md?key=semester_6%2Fobject_oriented_analysis_and_design%3Ahealth-care-class-diagram-code) — Object Oriented Analysis and Design, chapter 4
- [Marina class diagram implementation code](https://www.bctengineer.com/question.md?key=semester_6%2Fobject_oriented_analysis_and_design%3Amarina-class-diagram-implementation-code) — Object Oriented Analysis and Design, chapter 4

## Related in other subjects

- [Normalize sale relation up to 4NF](https://www.bctengineer.com/question.md?key=semester_6%2Fdatabase_management_system%3Anormalization-sale-example) — Database Management System, chapter 4
- [ILD as system-specific; focal point recurrence](https://www.bctengineer.com/question.md?key=semester_5%2Ftheory_of_structures_ii%3Aild-system-specific-focal-point-recurrence) — Theory of Structures II, chapter 4
- [General block diagram of a control system](https://www.bctengineer.com/question.md?key=semester_3%2Fcontrol_systems%3Ageneral-bd-control-system) — Control Systems, chapter 1
- [Force-couple system about a point](https://www.bctengineer.com/question.md?key=semester_1%2Fapplied_mechanics%3Aforce-couple-system-beam-60kn-20knm-50kn) — Applied Mechanics, chapter 3
