---
title: "XYZ Marina class diagram"
subject: "Object Oriented Analysis and Design"
chapter: 2
key: "semester_6/object_oriented_analysis_and_design:marina-class-diagram"
source: https://www.bctengineer.com/q/semester_6/object_oriented_analysis_and_design/marina-class-diagram
site: BCT Engineering
---

# XYZ Marina class diagram

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

- Asked in: 2073 Bhadra, 8 marks
- Answer checked by Claude Sonnet 5.5 on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_6/object_oriented_analysis_and_design/marina-class-diagram
- Whole chapter: https://www.bctengineer.com/md/semester_6/object_oriented_analysis_and_design/chapter-2

## Question

For the case study given below identify all classes, their relationships, attributes and methods for each class. Also draw class diagram using standard UML Notation.
XYZ Marina is privately owned corporation that rents boats and provides boat services on a lake. The Corporation needs automated system to track customers, leased slips (Each space for boat in lake) and boats in the slips. The corporation has two types of boats sail boat and power boat. Both types of boats are uniquely identified by their attributes like registration number, manufacture year and boat length. The boat can be leased on daily basis or yearly basis. The system should perform following tasks creating lease, computing lease amount, assigning boats. The system should also have features of search for vacant slips leased to specific customers and generating customized reports. The system should have to implement billing system as well.

## Short answer

Classes include abstract Boat with subclasses SailBoat and PowerBoat, Customer, Slip, Lease, Bill, and Report. Customer signs Leases that assign a Slip and a Boat; each Lease generates Bills; Customer owns Boats. Key methods: createLease(), computeAmount(), isAvailable(), generateBill().

## Answer

**Classes** (nouns): `Customer`, `Slip`, `Boat` (abstract), `SailBoat`, `PowerBoat`, `Lease`, `Bill`, `Report` (generated report), `Marina` (system facade).

**Attributes and methods**

| Class | Attributes | Methods |
|---|---|---|
| Customer | customerId, name, address, phone | createLease(), getLeases() |
| Slip | slipNo, location, size, isVacant | isAvailable(), assign(boat) |
| Boat (abstract) | registrationNo, manufactureYear, length | getDetails() |
| SailBoat | sailArea | - |
| PowerBoat | engineType | - |
| Lease | leaseId, startDate, endDate, type (daily/yearly), amount | computeAmount(), assignBoat(), cancel() |
| Bill | billId, date, amount, paid | generateBill(), pay() |
| Report | reportType, date | generate(customized) |
| Marina | name | searchVacantSlips(), searchSlipsByCustomer(c), createLease() |

**Relationships**
- `Boat` is generalised into `SailBoat` and `PowerBoat`.
- `Customer` 1 - 0..* `Lease`; `Lease` * - 1 `Slip`; `Lease` * - 1 `Boat` (a boat occupies a leased slip); `Customer` 1 - 0..* `Boat` (owns).
- `Lease` 1 - 1..* `Bill`.
- `Marina` aggregates `Customer`, `Slip`, `Boat` and produces `Report`s.

```text
+----------+ 1   * +--------+ *   1 +--------+
| Customer |-------| Lease  |-------|  Slip  |
|----------| signs |--------|       |--------|
| id,name  |       | type   |       | slipNo |
| address  |       | dates  |       | size   |
+----------+       | amount |       +--------+
   | 1             +--------+
   | owns            | *   | 1
   | *               | 1   | 1..*
+-----------+        |  +--------+
| Boat      |--------+  |  Bill  |
| <<abstract>>  leased   +--------+
|-----------|
| regNo     |
| mfgYear   |
| length    |
+-----------+
   ^       ^
 SailBoat PowerBoat
```

The diagram uses standard UML: boxes with name, attributes and operations; solid lines with multiplicities for associations; a hollow triangle for generalization.

## Check yourself

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

1. How are sail boats and power boats modelled?
   A. SailBoat and PowerBoat are generalizations of an abstract Boat holding the common attributes
   B. Two unrelated classes with duplicate attributes
   C. Boat is a subclass of SailBoat
   D. As attributes of Slip
   Answer: A. Common attributes (registration number, year, length) go in abstract Boat; the subclasses add their own. (Key point: Generalization of boats)

2. Which class holds computeAmount() and the daily/yearly type?
   A. Slip
   B. Customer
   C. Report
   D. Lease
   Answer: D. Lease holds type, dates and amount, so it computes the lease amount. (Key point: Where lease amount is computed)

3. Which relationships link Lease to other classes?
   A. Lease 1 - 1 Customer only
   B. Customer 1 - 0..* Lease, Lease * - 1 Slip, Lease * - 1 Boat, Lease 1 - 1..* Bill
   C. Lease is a subclass of Bill
   D. Lease is composed of Boats
   Answer: B. A customer can have many leases; each lease is for one slip and boat and produces one or more bills. (Key point: Lease and billing relationships)

4. Which notation represents generalization in the class diagram?
   A. A dashed arrow
   B. A filled diamond
   C. A hollow triangle on the superclass end
   D. A plain line with no symbol
   Answer: C. Generalization uses a solid line with a hollow triangle pointing to the superclass. (Key point: UML notation)

## Related in Object Oriented Analysis and Design

- [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
- [Coffee vending machine use case diagram](https://www.bctengineer.com/question.md?key=semester_6%2Fobject_oriented_analysis_and_design%3Acoffee-vending-machine-use-case) — Object Oriented Analysis and Design, chapter 2
- [Four class relationships from figure](https://www.bctengineer.com/question.md?key=semester_6%2Fobject_oriented_analysis_and_design%3Aclass-relationships-from-figure) — 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
- [Identify conceptual classes; create domain model](https://www.bctengineer.com/question.md?key=semester_6%2Fobject_oriented_analysis_and_design%3Aconceptual-classes-domain-model-steps) — Object Oriented Analysis and Design, chapter 2
- [Create classes from design class diagrams](https://www.bctengineer.com/question.md?key=semester_6%2Fobject_oriented_analysis_and_design%3Aclasses-from-design-class-diagram) — Object Oriented Analysis and Design, chapter 4, asked 2×

## Related in other subjects

- [Standard hydrogen electrode and cu notation](https://www.bctengineer.com/question.md?key=semester_2%2Fengineering_chemistry%3Astandard-hydrogen-electrode) — Engineering Chemistry, chapter 1
- [Case study: new system vs existing (cost, manpower)](https://www.bctengineer.com/question.md?key=semester_5%2Finstrumentation_ii%3Acs-cost-manpower-automation) — Instrumentation II, chapter 10, asked 4×
- [Case study: current control and recommendation](https://www.bctengineer.com/question.md?key=semester_5%2Finstrumentation_ii%3Acs-existing-recommend-problems) — Instrumentation II, chapter 10, asked 3×
- [Case study: processing plants and improvement](https://www.bctengineer.com/question.md?key=semester_5%2Finstrumentation_ii%3Acs-processing-plants) — Instrumentation II, chapter 10, asked 2×
