digraph LodgeReservationSystem { // Graph attributes rankdir=TB; node [shape=record, fontname="Arial", fontsize=10]; edge [fontname="Arial", fontsize=8]; // Package: lodge.data subgraph cluster_data { label="lodge.data"; style=filled; color=lightgrey; // Core data classes Account [label="{Account|+ account_number: String\l+ phone_number: String\l+ mailing_address: Address\l+ email_address: EmailAddress\l+ reservations: AccountReservationList\l|+ add(Reservation): boolean\l+ findReservation(String): Reservation\l+ getAllReservations(): ListIterator\\l+ update(Account): void\l+ Write(Account): void\l}"]; AccountList [label="{AccountList|extends ArrayList\|+ accountSerial(String, Address, EmailAddress): String\l+ add(Account): boolean\l+ find(String): Account\l+ save(Account): void\l+ getListOfReservations(): List\\l+ showReservationList(): void\l}"]; AccountReservationList [label="{AccountReservationList|extends ArrayList\|+ add(IReservation): boolean\l+ find(String): Reservation\l+ update(AccountReservationList): void\l+ toString(): String\l}"]; Address [label="{Address|+ street: String\l+ city: String\l+ state: String\l+ zip: String\l|+ getStreet(): String\l+ setStreet(String): void\l+ getCity(): String\l+ setCity(String): void\l+ getState(): String\l+ setState(String): void\l+ getZip(): String\l+ setZip(String): void\l+ equals(Object): boolean\l+ hashCode(): int\l+ toString(): String\l}"]; EmailAddress [label="{EmailAddress|+ email_address: String\l|+ getEmail_address(): String\l+ setEmail_address(String): void\l+ equals(Object): boolean\l+ hashCode(): int\l+ toString(): String\l}"]; DataRepository [label="{DataRepository|- directoryPath: String\l- instance: DataRepository\l|+ setDataStoreRoot(String): void\l+ getPath(): String\l+ Reservation(String): Reservation\l+ WalkFileSystemTree(AccomodationManager, Path): void\l+ LoadAccount(Path): Account\l}"]; // Enums KitchenTypeEnum [label="{«enumeration»\lKitchenTypeEnum|None\lKitchenette\lFullKitchen\l}"]; ReservationStatusEnum [label="{«enumeration»\lReservationStatusEnum|Draft\lCanceled\lCompleted\l}"]; // Exceptions DuplicateObjectException [label="{DuplicateObjectException|+ DuplicateObjectException()\l+ DuplicateObjectException(String)\l}"]; IllegalOperationException [label="{IllegalOperationException|+ IllegalOperationException()\l+ IllegalOperationException(String)\l}"]; } // Package: lodge.reservation subgraph cluster_reservation { label="lodge.reservation"; style=filled; color=lightblue; IReservation [label="{«interface»\lIReservation|+ ReservationType(): String\l+ getReservation_number(): String\l+ getAccountNumber(): String\l+ getPhysical_address(): Address\l+ getPricePerNight(): float\l+ calculatePrice(): float\l+ checkValid(): boolean\l}"]; Reservation [label="{«abstract»\lReservation|# 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|+ getReservation_number(): String\l+ setReservation_number(String): void\l+ getAccountNumber(): String\l+ setAccountNumber(String): void\l+ getPhysical_address(): Address\l+ setPhysical_address(Address): void\l+ Write(Reservation): void\l+ Change(Reservation, ReservationStatusEnum): void\l+ update(Reservation): void\l+ ReservationType(): String\l}"]; } // Package: lodge.reservationsystem subgraph cluster_reservationsystem { label="lodge.reservationsystem"; style=filled; color=lightyellow; AccomodationManager [label="{AccomodationManager|- accounts: AccountList\l|+ loadAll(): void\l+ load(Path): void\l+ retrieveLoadedAccounts(): List\\l+ retrieveAccount(String): Account\l+ AddAccount(Account): void\l+ UpdateAccount(Account): void\l+ newAccount(String, Address, EmailAddress): Account\l+ addReservation(Account, Reservation): boolean\l+ findReservation(String): Reservation\l+ getReservationList(): List\\l+ showReservationList(): void\l}"]; HotelReservation [label="{HotelReservation|extends Reservation|+ HotelReservation()\l+ HotelReservation(Address)\l+ copy(String): Reservation\l+ ReservationType(): String\l+ checkValid(): boolean\l+ getPricePerNight(): float\l+ calculatePrice(): float\l}"]; CabinReservation [label="{CabinReservation|extends Reservation|+ CabinReservation()\l+ CabinReservation(Address)\l+ ReservationType(): String\l+ checkValid(): boolean\l+ getPricePerNight(): float\l+ calculatePrice(): float\l}"]; HouseReservation [label="{HouseReservation|extends Reservation|+ HouseReservation()\l+ HouseReservation(Address)\l+ copy(String): Reservation\l+ ReservationType(): String\l+ checkValid(): boolean\l+ getPricePerNight(): float\l+ calculatePrice(): float\l}"]; } // Test class TestReservations [label="{TestReservations|+ main(String[]): void\l}"]; // Relationships // Composition relationships Account -> AccountReservationList [label="1" arrowhead=diamond]; Account -> Address [label="1" arrowhead=diamond]; Account -> EmailAddress [label="1" arrowhead=diamond]; AccountList -> Account [label="0...*" arrowhead=odiamond]; AccountReservationList -> IReservation [label="0...*" arrowhead=odiamond]; AccomodationManager -> AccountList [label="1" arrowhead=diamond]; // Inheritance relationships Reservation -> IReservation [arrowhead=empty, style=dashed, label="implements"]; HotelReservation -> Reservation [arrowhead=empty, label="extends"]; CabinReservation -> Reservation [arrowhead=empty, label="extends"]; HouseReservation -> Reservation [arrowhead=empty, label="extends"]; // Dependencies and associations Reservation -> Address [label="1", arrowhead=diamond]; Reservation -> KitchenTypeEnum [arrowhead=open, style=dashed]; Reservation -> ReservationStatusEnum [arrowhead=open, style=dashed]; DataRepository -> AccomodationManager [arrowhead=open, style=dashed]; AccomodationManager -> Reservation [arrowhead=open, style=dashed]; AccomodationManager -> DataRepository [arrowhead=open, style=dashed]; TestReservations -> AccomodationManager [arrowhead=open, style=dashed]; TestReservations -> HotelReservation [arrowhead=open, style=dashed]; TestReservations -> CabinReservation [arrowhead=open, style=dashed]; TestReservations -> HouseReservation [arrowhead=open, style=dashed]; // Exception relationships AccountList -> DuplicateObjectException [arrowhead=open, style=dashed]; AccountReservationList -> DuplicateObjectException [arrowhead=open, style=dashed]; Reservation -> IllegalOperationException [arrowhead=open, style=dashed]; Reservation -> ZonedDateTime [arrowhead=open, style=dashed]; }