diff --git a/README.md b/README.md index b8f5e21..b1594d9 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,8 @@ | -------- | ------- | | Java | 21 | | json lib | gson-2.13.1 | -| VSCode | 1.103 | +| VSCode | 1.103 | +| graphviz | 2.42.4 | ### | extension | @@ -23,6 +24,7 @@ java -cp .\libs\gson-2.13.1.jar;.\libs\reservationsystem.jar lodge.TestReservati gradle clean build jar ### Dot file review for classdiagram -### dot -Tsvg classdiagram.dot -o classdiagram.svg +Install Graphviz in your OS +dot -Tsvg classdiagram.dot -o classdiagram.svg diff --git a/uml/classdiagram.svg b/uml/classdiagram.svg index b84b774..6a19cf5 100644 --- a/uml/classdiagram.svg +++ b/uml/classdiagram.svg @@ -1,144 +1,144 @@ - - + LodgeReservationSystem - - -cluster_lodge - -lodge - + cluster_data - -lodge.data + +lodge.data cluster_reservation - -lodge.reservation + +lodge.reservation cluster_reservationsystem - -lodge.reservationsystem + +lodge.reservationsystem + + +cluster_lodge + +lodge Account - -Account - -+ account_number: String -+ phone_number: String -+ mailing_address: Address -+ email_address: EmailAddress -- reservations: AccountReservationList - -+ Account() -+ Account(String, String, Address, EmailAddress) -+ Account(String, Address, EmailAddress) -+ add(Reservation): boolean -+ findReservation(String): Reservation -+ getAllReservations(): ListIterator<IReservation> -+ update(Account): void -+ toString(): String -+ static Write(Account): void + +Account + ++ account_number: String ++ phone_number: String ++ mailing_address: Address ++ email_address: EmailAddress +- reservations: AccountReservationList + ++ Account() ++ Account(String, String, Address, EmailAddress) ++ Account(String, Address, EmailAddress) ++ add(Reservation): boolean ++ findReservation(String): Reservation ++ getAllReservations(): ListIterator<IReservation> ++ update(Account): void ++ toString(): String ++ static Write(Account): void Address - + Address - -+ street: String -+ city: String -+ state: String -+ zip: String - -+ Address(String, String, String, String) -+ getters/setters -+ hashCode(): int -+ equals(Object): boolean -+ toString(): String + ++ street: String ++ city: String ++ state: String ++ zip: String + ++ Address(String, String, String, String) ++ getters/setters ++ hashCode(): int ++ equals(Object): boolean ++ toString(): String Account->Address - - -mailing_address + + +mailing_address EmailAddress - -EmailAddress - -+ email_address: String - -+ EmailAddress(String) -+ getEmail_address(): String -+ setEmail_address(String): void -+ hashCode(): int -+ equals(Object): boolean -+ toString(): String + +EmailAddress + ++ email_address: String + ++ EmailAddress(String) ++ getEmail_address(): String ++ setEmail_address(String): void ++ hashCode(): int ++ equals(Object): boolean ++ toString(): String Account->EmailAddress - - -email_address + + +email_address AccountReservationList - -AccountReservationList - -extends ArrayList<IReservation> - -- static reservationSerial(Reservation): String -+ add(IReservation): boolean -+ find(String): Reservation -+ update(AccountReservationList): void -+ toString(): String + +AccountReservationList + +extends ArrayList<IReservation> + +- static reservationSerial(Reservation): String ++ add(IReservation): boolean ++ find(String): Reservation ++ update(AccountReservationList): void ++ toString(): String Account->AccountReservationList - - -contains + + +contains AccountList - -AccountList - -extends ArrayList<Account> - -+ static accountSerial(...): String -+ add(Account): boolean -+ save(Account): void -+ find(String): Account -+ getListOfReservations(): List<? extends IReservation> -+ showReservationList(): void + +AccountList + +extends ArrayList<Account> + ++ static accountSerial(...): String ++ add(Account): boolean ++ save(Account): void ++ find(String): Account ++ getListOfReservations(): List<? extends IReservation> ++ showReservationList(): void AccountList->Account - - -contains + + +contains @@ -155,11 +155,11 @@ ReservationStatusEnum - -ReservationStatusEnum - -<<enumeration>> - + +ReservationStatusEnum + +<<enumeration>> + Draft Canceled Completed @@ -178,292 +178,292 @@ IllegalOperationException - -IllegalOperationException - -extends RuntimeException - -+ IllegalOperationException() -+ IllegalOperationException(String) + +IllegalOperationException + +extends RuntimeException + ++ IllegalOperationException() ++ IllegalOperationException(String) IReservation - -IReservation - -<<interface>> - -+ ReservationType(): String -+ static copy(String): Reservation -+ getReservation_number(): String -+ getAccountNumber(): String -+ getPhysical_address(): Address -+ getPricePerNight(): float -+ calculatePrice(): float -+ checkValid(): boolean + +IReservation + +<<interface>> + ++ ReservationType(): String ++ static copy(String): Reservation ++ getReservation_number(): String ++ getAccountNumber(): String ++ getPhysical_address(): Address ++ getPricePerNight(): float ++ calculatePrice(): float ++ checkValid(): boolean Reservation - -Reservation - -<<abstract>> - -# type: char -# reservation_number: String -# physical_address: Address -# mailing_address: Address -# reservation_start_date: ZonedDateTime -# reservation_end_date: ZonedDateTime -# reservation_status: ReservationStatusEnum -# kitchen: KitchenTypeEnum -# numberOfBeds: Integer -# numberOfBedRooms: Integer -# numberOfBathRooms: Integer -# numberOfFloors: Integer -# squareFeet: Integer -# price: Float -# accountNumber: String - -# Reservation() -+ getters/setters -+ Write(Reservation): void -+ Change(Reservation, ReservationStatusEnum): void -+ update(Reservation): void -+ abstract ReservationType(): String + +Reservation + +<<abstract>> + +# type: char +# reservation_number: String +# physical_address: Address +# mailing_address: Address +# reservation_start_date: ZonedDateTime +# reservation_end_date: ZonedDateTime +# reservation_status: ReservationStatusEnum +# kitchen: KitchenTypeEnum +# numberOfBeds: Integer +# numberOfBedRooms: Integer +# numberOfBathRooms: Integer +# numberOfFloors: Integer +# squareFeet: Integer +# price: Float +# accountNumber: String + +# Reservation() ++ getters/setters ++ Write(Reservation): void ++ Change(Reservation, ReservationStatusEnum): void ++ update(Reservation): void ++ abstract ReservationType(): String Reservation->Address - - -physical_address -mailing_address + + +physical_address +mailing_address Reservation->KitchenTypeEnum - - -kitchen + + +kitchen Reservation->ReservationStatusEnum - - -reservation_status + + +reservation_status Reservation->IllegalOperationException - - -throws + + +throws Reservation->IReservation - - -implements + + +implements AccountReservationList->DuplicateObjectException - - -throws + + +throws AccountReservationList->IReservation - - -contains 0..* + + +contains 0..* CabinReservation - -CabinReservation - -+ CabinReservation() -+ CabinReservation(Address) -+ ReservationType(): String -+ checkValid(): boolean -+ getPricePerNight(): float -+ calculatePrice(): float + +CabinReservation + ++ CabinReservation() ++ CabinReservation(Address) ++ ReservationType(): String ++ checkValid(): boolean ++ getPricePerNight(): float ++ calculatePrice(): float CabinReservation->Reservation - - -extends + + +extends HotelReservation - -HotelReservation - -+ HotelReservation() -+ HotelReservation(Address) -+ static copy(String): Reservation -+ ReservationType(): String -+ checkValid(): boolean -+ getPricePerNight(): float -+ calculatePrice(): float + +HotelReservation + ++ HotelReservation() ++ HotelReservation(Address) ++ static copy(String): Reservation ++ ReservationType(): String ++ checkValid(): boolean ++ getPricePerNight(): float ++ calculatePrice(): float HotelReservation->Reservation - - -extends + + +extends HouseReservation - -HouseReservation - -+ HouseReservation() -+ HouseReservation(Address) -+ static copy(String): Reservation -+ ReservationType(): String -+ checkValid(): boolean -+ getPricePerNight(): float -+ calculatePrice(): float + +HouseReservation + ++ HouseReservation() ++ HouseReservation(Address) ++ static copy(String): Reservation ++ ReservationType(): String ++ checkValid(): boolean ++ getPricePerNight(): float ++ calculatePrice(): float HouseReservation->Reservation - - -extends + + +extends AccomodationManager - -AccomodationManager - -- accounts: AccountList - -+ AccomodationManager(String) -+ setDataStoreRoot(String): void -+ loadAll(): void -+ load(Path): void -+ retrieveLoadedAccounts(): List<Account> -+ retrieveAccount(String): Account -+ AddAccount(Account): void -+ UpdateAccount(Account): void -+ newAccount(...): Account -+ addReservation(Account, Reservation): boolean -+ findReservation(String): Reservation -+ getReservationList(): List<? extends IReservation> -+ showReservationList(): void + +AccomodationManager + +- accounts: AccountList + ++ AccomodationManager(String) ++ setDataStoreRoot(String): void ++ loadAll(): void ++ load(Path): void ++ retrieveLoadedAccounts(): List<Account> ++ retrieveAccount(String): Account ++ AddAccount(Account): void ++ UpdateAccount(Account): void ++ newAccount(...): Account ++ addReservation(Account, Reservation): boolean ++ findReservation(String): Reservation ++ getReservationList(): List<? extends IReservation> ++ showReservationList(): void AccomodationManager->AccountList - - -accounts + + +accounts DataRepository - -DataRepository - -<<singleton>> - -- directoryPath: String -- static instance: DataRepository - -+ static getInstance(): DataRepository -+ static setDataStoreRoot(String): void -+ static getPath(): String -+ static Reservation(String): Reservation -+ static WalkFileSystemTree(...): void -+ static LoadAccount(Path): Account + +DataRepository + +<<singleton>> + +- directoryPath: String +- static instance: DataRepository + ++ static getInstance(): DataRepository ++ static setDataStoreRoot(String): void ++ static getPath(): String ++ static Reservation(String): Reservation ++ static WalkFileSystemTree(...): void ++ static LoadAccount(Path): Account AccomodationManager->DataRepository - - -uses + + +uses DataRepository->Account - - -creates + + +creates DataRepository->CabinReservation - - -creates + + +creates DataRepository->HotelReservation - - -creates + + +creates DataRepository->HouseReservation - - -creates + + +creates TestReservations - -TestReservations - -+ static main(String[]): void -+ static class getRepositoryConfig + +TestReservations + ++ static main(String[]): void ++ static class getRepositoryConfig TestReservations->CabinReservation - - -creates + + +creates TestReservations->HotelReservation - - -creates + + +creates TestReservations->HouseReservation - - -creates + + +creates TestReservations->AccomodationManager - - -uses + + +uses