Skip to main content

XYZ Marina class diagram

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().

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.

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

Attributes and methods

ClassAttributesMethods
CustomercustomerId, name, address, phonecreateLease(), getLeases()
SlipslipNo, location, size, isVacantisAvailable(), assign(boat)
Boat (abstract)registrationNo, manufactureYear, lengthgetDetails()
SailBoatsailArea-
PowerBoatengineType-
LeaseleaseId, startDate, endDate, type (daily/yearly), amountcomputeAmount(), assignBoat(), cancel()
BillbillId, date, amount, paidgenerateBill(), pay()
ReportreportType, dategenerate(customized)
MarinanamesearchVacantSlips(), 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 Reports.
+----------+ 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.

✓ Answer checked by Claude Sonnet 5.5

All Object Oriented Analysis and Design chapter 2 questions →