101 lines
7.0 KiB
Plaintext
101 lines
7.0 KiB
Plaintext
|
|
digraph LodgeReservationSystem {
|
||
|
|
// Graph settings
|
||
|
|
rankdir=TB;
|
||
|
|
node [shape=record, fontname="Arial", fontsize=10];
|
||
|
|
edge [fontname="Arial", fontsize=8];
|
||
|
|
|
||
|
|
// Define clusters for packages
|
||
|
|
subgraph cluster_data {
|
||
|
|
label="lodge.data";
|
||
|
|
style=filled;
|
||
|
|
color=lightgrey;
|
||
|
|
|
||
|
|
// Data classes
|
||
|
|
Account [label="{Account|+ account_number: String\l+ phone_number: String\l+ mailing_address: Address\l+ email_address: EmailAddress\l- reservation_list: AccountReservationList\l|+ add(Reservation): boolean\l+ findReservation(String): Reservation\l+ getAllReservations(): ListIterator\<IReservation\>\l+ update(Account): void\l+ Write(Account): void\l}"];
|
||
|
|
|
||
|
|
AccountList [label="{AccountList|extends ArrayList\<Account\>|+ accountSerial(...): String\l+ add(Account): boolean\l+ find(String): Account\l+ save(Account): void\l+ getListOfReservations(): List\<IReservation\>\l}"];
|
||
|
|
|
||
|
|
AccountReservationList [label="{AccountReservationList|extends ArrayList\<IReservation\>|- reservationSerial(Reservation): String\l+ add(IReservation): boolean\l+ find(String): Reservation\l+ update(AccountReservationList): void\l}"];
|
||
|
|
|
||
|
|
Address [label="{Address|+ street: String\l+ city: String\l+ state: String\l+ zip: String\l|+ getters/setters\l+ hashCode(): int\l+ equals(Object): boolean\l}"];
|
||
|
|
|
||
|
|
EmailAddress [label="{EmailAddress|+ email_address: String\l|+ getters/setters\l+ hashCode(): int\l+ equals(Object): boolean\l}"];
|
||
|
|
|
||
|
|
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|+ getters/setters\l+ Write(Reservation): void\l+ Change(Reservation, ReservationStatusEnum): void\l+ update(Reservation): void\l+ \<\<abstract\>\> ReservationType(): String\l}"];
|
||
|
|
|
||
|
|
DataRepository [label="{DataRepository|\<\<singleton\>\>|- directoryPath: String\l- instance: DataRepository\l|+ setDataStoreRoot(String): void\l+ getPath(): String\l+ Reservation(String): Reservation\l+ WalkFileSystemTree(...): void\l+ LoadAccount(Path): Account\l- loadReservation(...): void\l}"];
|
||
|
|
|
||
|
|
DuplicateObjectException [label="{DuplicateObjectException|extends RuntimeException||+ DuplicateObjectException()\l+ DuplicateObjectException(String)\l}"];
|
||
|
|
|
||
|
|
// Enums
|
||
|
|
KitchenTypeEnum [label="{KitchenTypeEnum|\<\<enumeration\>\>|None\lKitchenette\lFullKitchen\l}"];
|
||
|
|
|
||
|
|
ReservationStatusEnum [label="{ReservationStatusEnum|\<\<enumeration\>\>|Draft\lCanceled\lCompleted\l}"];
|
||
|
|
}
|
||
|
|
|
||
|
|
subgraph cluster_reservationsystem {
|
||
|
|
label="lodge.reservationsystem";
|
||
|
|
style=filled;
|
||
|
|
color=lightblue;
|
||
|
|
|
||
|
|
AccomodationManager [label="{AccomodationManager|- accounts: AccountList\l|+ AccomodationManager(String)\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(...): boolean\l+ findReservation(String): Reservation\l+ getReservationList(): List\<IReservation\>\l+ showReservationList(): void\l}"];
|
||
|
|
|
||
|
|
IReservation [label="{IReservation|\<\<interface\>\>||+ ReservationType(): String\l+ getReservation_number(): String\l+ getAccountNumber(): String\l+ getPhysical_address(): Address\l+ getPricePerNight(): float\l+ calculatePrice(): float\l+ checkValid(): boolean\l}"];
|
||
|
|
|
||
|
|
HotelReservation [label="{HotelReservation|extends Reservation\limplements IReservation|# type: 'H'\l|+ HotelReservation(Address)\l+ ReservationType(): String\l+ checkValid(): boolean\l+ getPricePerNight(): float\l+ calculatePrice(): float\l+ Reservation(String): Reservation\l}"];
|
||
|
|
|
||
|
|
CabinReservation [label="{CabinReservation|extends Reservation\limplements IReservation|# type: 'C'\l|+ CabinReservation(Address)\l+ ReservationType(): String\l+ checkValid(): boolean\l+ getPricePerNight(): float\l+ calculatePrice(): float\l+ Reservation(String): Reservation\l}"];
|
||
|
|
|
||
|
|
HouseReservation [label="{HouseReservation|extends Reservation\limplements IReservation|# type: 'Z'\l|+ HouseReservation(Address)\l+ ReservationType(): String\l+ checkValid(): boolean\l+ getPricePerNight(): float\l+ calculatePrice(): float\l+ Reservation(String): Reservation\l}"];
|
||
|
|
|
||
|
|
IllegalOperationException [label="{IllegalOperationException|extends RuntimeException||+ IllegalOperationException()\l+ IllegalOperationException(String)\l}"];
|
||
|
|
}
|
||
|
|
|
||
|
|
subgraph cluster_main {
|
||
|
|
label="lodge";
|
||
|
|
style=filled;
|
||
|
|
color=lightyellow;
|
||
|
|
|
||
|
|
TestReservations [label="{TestReservations||+ main(String[]): void\l}"];
|
||
|
|
}
|
||
|
|
|
||
|
|
// Relationships
|
||
|
|
|
||
|
|
// Inheritance relationships
|
||
|
|
AccountList -> Account [arrowhead=diamond, label="contains"];
|
||
|
|
AccountReservationList -> IReservation [arrowhead=diamond, label="contains"];
|
||
|
|
|
||
|
|
HotelReservation -> Reservation [arrowhead=empty];
|
||
|
|
CabinReservation -> Reservation [arrowhead=empty];
|
||
|
|
HouseReservation -> Reservation [arrowhead=empty];
|
||
|
|
|
||
|
|
HotelReservation -> IReservation [arrowhead=empty, style=dashed];
|
||
|
|
CabinReservation -> IReservation [arrowhead=empty, style=dashed];
|
||
|
|
HouseReservation -> IReservation [arrowhead=empty, style=dashed];
|
||
|
|
|
||
|
|
// Composition/Aggregation relationships
|
||
|
|
Account -> Address [arrowhead=diamond, label="mailing_address"];
|
||
|
|
Account -> EmailAddress [arrowhead=diamond, label="email_address"];
|
||
|
|
Account -> AccountReservationList [arrowhead=diamond, label="reservation_list"];
|
||
|
|
|
||
|
|
Reservation -> Address [arrowhead=diamond, label="physical_address\nmailing_address"];
|
||
|
|
Reservation -> KitchenTypeEnum [arrowhead=open, label="kitchen"];
|
||
|
|
Reservation -> ReservationStatusEnum [arrowhead=open, label="reservation_status"];
|
||
|
|
|
||
|
|
AccomodationManager -> AccountList [arrowhead=diamond, label="accounts"];
|
||
|
|
AccomodationManager -> DataRepository [arrowhead=open, label="uses"];
|
||
|
|
|
||
|
|
// Usage relationships
|
||
|
|
TestReservations -> AccomodationManager [arrowhead=open, label="uses"];
|
||
|
|
TestReservations -> HotelReservation [arrowhead=open, label="creates"];
|
||
|
|
TestReservations -> CabinReservation [arrowhead=open, label="creates"];
|
||
|
|
TestReservations -> HouseReservation [arrowhead=open, label="creates"];
|
||
|
|
|
||
|
|
DataRepository -> Account [arrowhead=open, label="loads"];
|
||
|
|
DataRepository -> Reservation [arrowhead=open, label="creates"];
|
||
|
|
|
||
|
|
// Exception relationships
|
||
|
|
AccountList -> DuplicateObjectException [arrowhead=open, style=dashed, label="throws"];
|
||
|
|
AccountReservationList -> DuplicateObjectException [arrowhead=open, style=dashed, label="throws"];
|
||
|
|
Reservation -> IllegalOperationException [arrowhead=open, style=dashed, label="throws"];
|
||
|
|
}
|