diff --git a/uml/classdiagram.dot b/uml/classdiagram.dot index 82ab78a..a47a68b 100644 --- a/uml/classdiagram.dot +++ b/uml/classdiagram.dot @@ -10,11 +10,7 @@ digraph LodgeReservationSystem { 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- 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\\l+ update(Account): void\l+ toString(): String\l+ static Write(Account): void\l}"]; - - AccountList [label="{AccountList|extends ArrayList\|+ static accountSerial(...): String\l+ add(Account): boolean\l+ save(Account): void\l+ find(String): Account\l+ getListOfReservations(): List\\l+ showReservationList(): void\l}"]; - + // 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}"]; @@ -29,6 +25,16 @@ digraph LodgeReservationSystem { IllegalOperationException [label="{IllegalOperationException|extends RuntimeException|+ IllegalOperationException()\l+ IllegalOperationException(String)\l}"]; + subgraph cluster_reservation { + label="lodge.reservation"; + style=filled; + color=lightblue; + 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\\l+ update(Account): void\l+ toString(): String\l+ static Write(Account): void\l}"]; + + AccountList [label="{AccountList|extends ArrayList\|+ static accountSerial(...): String\l+ add(Account): boolean\l+ save(Account): void\l+ find(String): Account\l+ getListOfReservations(): List\\l+ showReservationList(): void\l}"]; + + } + subgraph cluster_reservation { label="lodge.reservation"; style=filled; diff --git a/uml/classdiagram.svg b/uml/classdiagram.svg index 6a19cf5..157105e 100644 --- a/uml/classdiagram.svg +++ b/uml/classdiagram.svg @@ -4,55 +4,33 @@ - - + + LodgeReservationSystem - + 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 + +lodge - + Address Address @@ -68,15 +46,8 @@ + equals(Object): boolean + toString(): String - - -Account->Address - - -mailing_address - - + EmailAddress EmailAddress @@ -90,12 +61,87 @@ + equals(Object): boolean + toString(): String + + +KitchenTypeEnum + +KitchenTypeEnum + +<<enumeration>> + +None +Kitchenette +FullKitchen + + + +ReservationStatusEnum + +ReservationStatusEnum + +<<enumeration>> + +Draft +Canceled +Completed + + + +DuplicateObjectException + +DuplicateObjectException + +extends RuntimeException + ++ DuplicateObjectException() ++ DuplicateObjectException(String) + + + +IllegalOperationException + +IllegalOperationException + +extends RuntimeException + ++ IllegalOperationException() ++ IllegalOperationException(String) + + + +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->Address + + +mailing_address + Account->EmailAddress - - -email_address + + +email_address @@ -114,77 +160,31 @@ 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 - - - -KitchenTypeEnum - -KitchenTypeEnum - -<<enumeration>> - -None -Kitchenette -FullKitchen - - - -ReservationStatusEnum - -ReservationStatusEnum - -<<enumeration>> - -Draft -Canceled -Completed - - - -DuplicateObjectException - -DuplicateObjectException - -extends RuntimeException - -+ DuplicateObjectException() -+ DuplicateObjectException(String) - - - -IllegalOperationException - -IllegalOperationException - -extends RuntimeException - -+ IllegalOperationException() -+ IllegalOperationException(String) + + +contains @@ -237,233 +237,233 @@ Reservation->Address - - -physical_address -mailing_address + + +physical_address +mailing_address Reservation->KitchenTypeEnum - - -kitchen + + +kitchen Reservation->ReservationStatusEnum - + 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