2025-09-24 20:05:55 -04:00
|
|
|
digraph LodgeReservationSystem {
|
|
|
|
|
// Graph attributes
|
|
|
|
|
rankdir=TB;
|
2025-09-29 09:59:37 -04:00
|
|
|
node [shape=record, fontname="Times New Roman", fontsize=10];
|
|
|
|
|
edge [fontname="Times New Roman", fontsize=9];
|
2025-09-24 20:05:55 -04:00
|
|
|
|
|
|
|
|
// Package clustering
|
|
|
|
|
subgraph cluster_data {
|
|
|
|
|
label="lodge.data";
|
|
|
|
|
style=filled;
|
|
|
|
|
color=lightgrey;
|
|
|
|
|
|
|
|
|
|
// Data classes
|
|
|
|
|
Address [label="{Address|+ street: String\l+ city: String\l+ state: String\l+ zip: String\l|+ Address(String, String, String, String)\l+ getters/setters\l+ hashCode(): int\l+ equals(Object): boolean\l+ toString(): String\l}"];
|
|
|
|
|
|
|
|
|
|
EmailAddress [label="{EmailAddress|+ email_address: String\l|+ EmailAddress(String)\l+ getEmail_address(): String\l+ setEmail_address(String): void\l+ hashCode(): int\l+ equals(Object): boolean\l+ toString(): String\l}"];
|
|
|
|
|
|
|
|
|
|
// Enums
|
|
|
|
|
KitchenTypeEnum [label="{KitchenTypeEnum|\<\<enumeration\>\>|None\lKitchenette\lFullKitchen\l}"];
|
|
|
|
|
|
|
|
|
|
ReservationStatusEnum [label="{ReservationStatusEnum|\<\<enumeration\>\>|Draft\lCanceled\lCompleted\l}"];
|
|
|
|
|
|
|
|
|
|
// Exceptions
|
|
|
|
|
DuplicateObjectException [label="{DuplicateObjectException|extends RuntimeException|+ DuplicateObjectException()\l+ DuplicateObjectException(String)\l}"];
|
|
|
|
|
|
|
|
|
|
IllegalOperationException [label="{IllegalOperationException|extends RuntimeException|+ IllegalOperationException()\l+ IllegalOperationException(String)\l}"];
|
|
|
|
|
|
|
|
|
|
subgraph cluster_account {
|
|
|
|
|
label="lodge.reservation";
|
|
|
|
|
style=filled;
|
|
|
|
|
color="#e9d5ba";
|
|
|
|
|
Account [label="{Account|+ account_number: String\l+ phone_number: String\l+ mailing_address: Address\l+ email_address: EmailAddress\l- reservations: AccountReservationList\l|+ Account()\l+ Account(String, String, Address, EmailAddress)\l+ Account(String, Address, EmailAddress)\l+ add(Reservation): boolean\l+ findReservation(String): Reservation\l+ getAllReservations(): ListIterator\<IReservation\>\l+ update(Account): void\l+ toString(): String\l+ static Write(Account): void\l}"];
|
|
|
|
|
|
|
|
|
|
AccountList [label="{AccountList|extends ArrayList\<Account\>|+ static accountSerial(...): String\l+ add(Account): boolean\l+ save(Account): void\l+ find(String): Account\l+ getListOfReservations(): List\<? extends IReservation\>\l+ showReservationList(): void\l}"];
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
subgraph cluster_reservation {
|
|
|
|
|
label="lodge.reservation";
|
|
|
|
|
style=filled;
|
|
|
|
|
color=lightblue;
|
|
|
|
|
|
|
|
|
|
// Interface
|
|
|
|
|
IReservation [label="{IReservation|\<\<interface\>\>|+ ReservationType(): String\l+ static copy(String): Reservation\l+ getReservation_number(): String\l+ getAccountNumber(): String\l+ getPhysical_address(): Address\l+ getPricePerNight(): float\l+ calculatePrice(): float\l+ checkValid(): boolean\l}"];
|
|
|
|
|
|
|
|
|
|
// Abstract class
|
|
|
|
|
Reservation [label="{Reservation|\<\<abstract\>\>|# type: char\l# reservation_number: String\l# physical_address: Address\l# mailing_address: Address\l# reservation_start_date: ZonedDateTime\l# reservation_end_date: ZonedDateTime\l# reservation_status: ReservationStatusEnum\l# kitchen: KitchenTypeEnum\l# numberOfBeds: Integer\l# numberOfBedRooms: Integer\l# numberOfBathRooms: Integer\l# numberOfFloors: Integer\l# squareFeet: Integer\l# price: Float\l# accountNumber: String\l|# Reservation()\l+ getters/setters\l+ Write(Reservation): void\l+ Change(Reservation, ReservationStatusEnum): void\l+ update(Reservation): void\l+ abstract ReservationType(): String\l}"];
|
|
|
|
|
|
|
|
|
|
// Reservation List
|
|
|
|
|
AccountReservationList [label="{AccountReservationList|extends ArrayList\<IReservation\>|- static reservationSerial(Reservation): String\l+ add(IReservation): boolean\l+ find(String): Reservation\l+ update(AccountReservationList): void\l+ toString(): String\l}"];
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
subgraph cluster_reservationsystem {
|
|
|
|
|
label="lodge.reservationsystem";
|
|
|
|
|
style=filled;
|
|
|
|
|
color=lightyellow;
|
|
|
|
|
|
|
|
|
|
// Concrete reservation classes
|
|
|
|
|
CabinReservation [label="{CabinReservation|+ CabinReservation()\l+ CabinReservation(Address)\l+ ReservationType(): String\l+ checkValid(): boolean\l+ getPricePerNight(): float\l+ calculatePrice(): float\l}"];
|
|
|
|
|
|
|
|
|
|
HotelReservation [label="{HotelReservation|+ HotelReservation()\l+ HotelReservation(Address)\l+ static copy(String): Reservation\l+ ReservationType(): String\l+ checkValid(): boolean\l+ getPricePerNight(): float\l+ calculatePrice(): float\l}"];
|
|
|
|
|
|
|
|
|
|
HouseReservation [label="{HouseReservation|+ HouseReservation()\l+ HouseReservation(Address)\l+ static copy(String): Reservation\l+ ReservationType(): String\l+ checkValid(): boolean\l+ getPricePerNight(): float\l+ calculatePrice(): float\l}"];
|
|
|
|
|
|
|
|
|
|
AccomodationManager [label="{AccomodationManager|- accounts: AccountList\l|+ AccomodationManager(String)\l+ setDataStoreRoot(String): void\l+ loadAll(): void\l+ load(Path): void\l+ retrieveLoadedAccounts(): List\<Account\>\l+ retrieveAccount(String): Account\l+ AddAccount(Account): void\l+ UpdateAccount(Account): void\l+ newAccount(...): Account\l+ addReservation(Account, Reservation): boolean\l+ findReservation(String): Reservation\l+ getReservationList(): List\<? extends IReservation\>\l+ showReservationList(): void\l}"];
|
|
|
|
|
|
|
|
|
|
DataRepository [label="{DataRepository|\<\<singleton\>\>|- directoryPath: String\l- static instance: DataRepository\l|+ static getInstance(): DataRepository\l+ static setDataStoreRoot(String): void\l+ static getPath(): String\l+ static Reservation(String): Reservation\l+ static WalkFileSystemTree(...): void\l+ static LoadAccount(Path): Account\l}"];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
subgraph cluster_lodge {
|
|
|
|
|
label="lodge";
|
|
|
|
|
style=filled;
|
|
|
|
|
color=lightcoral;
|
|
|
|
|
|
|
|
|
|
TestReservations [label="{TestReservations|+ static main(String[]): void\l+ static class getRepositoryConfig\l}"];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Inheritance relationships
|
|
|
|
|
Reservation -> IReservation [arrowhead=empty, style=dashed, label="implements"];
|
|
|
|
|
CabinReservation -> Reservation [arrowhead=empty, label="extends"];
|
|
|
|
|
HotelReservation -> Reservation [arrowhead=empty, label="extends"];
|
|
|
|
|
HouseReservation -> Reservation [arrowhead=empty, label="extends"];
|
|
|
|
|
|
|
|
|
|
// Composition relationships
|
|
|
|
|
Account -> AccountReservationList [arrowhead=diamond, label="contains"];
|
|
|
|
|
Account -> Address [arrowhead=diamond, label="mailing_address"];
|
|
|
|
|
Account -> EmailAddress [arrowhead=diamond, label="email_address"];
|
|
|
|
|
AccountList -> Account [arrowhead=odiamond, label="contains 0..*"];
|
|
|
|
|
AccountReservationList -> IReservation [arrowhead=odiamond, label="contains 0..*"];
|
|
|
|
|
Reservation -> Address [arrowhead=diamond, label="physical_address\nmailing_address"];
|
|
|
|
|
Reservation -> KitchenTypeEnum [arrowhead=diamond, label="kitchen"];
|
|
|
|
|
Reservation -> ReservationStatusEnum [arrowhead=diamond, label="reservation_status"];
|
|
|
|
|
AccomodationManager -> AccountList [arrowhead=diamond, label="accounts"];
|
|
|
|
|
|
|
|
|
|
// Dependencies
|
|
|
|
|
AccomodationManager -> DataRepository [arrowhead=open, style=dashed, label="uses"];
|
|
|
|
|
DataRepository -> Account [arrowhead=open, style=dashed, label="creates"];
|
|
|
|
|
DataRepository -> CabinReservation [arrowhead=open, style=dashed, label="creates"];
|
|
|
|
|
DataRepository -> HotelReservation [arrowhead=open, style=dashed, label="creates"];
|
|
|
|
|
DataRepository -> HouseReservation [arrowhead=open, style=dashed, label="creates"];
|
|
|
|
|
TestReservations -> AccomodationManager [arrowhead=open, style=dashed, label="uses"];
|
|
|
|
|
TestReservations -> CabinReservation [arrowhead=open, style=dashed, label="creates"];
|
|
|
|
|
TestReservations -> HotelReservation [arrowhead=open, style=dashed, label="creates"];
|
|
|
|
|
TestReservations -> HouseReservation [arrowhead=open, style=dashed, label="creates"];
|
|
|
|
|
AccountReservationList -> DuplicateObjectException [arrowhead=open, style=dashed, label="throws"];
|
|
|
|
|
Reservation -> IllegalOperationException [arrowhead=open, style=dashed, label="throws"];
|
|
|
|
|
}
|