diff --git a/sdd/readme.docx b/sdd/readme.docx index 092d632..9885277 100644 Binary files a/sdd/readme.docx and b/sdd/readme.docx differ diff --git a/uml/classdiagram.dot b/uml/classdiagram.dot index 81423cf..57e8877 100644 --- a/uml/classdiagram.dot +++ b/uml/classdiagram.dot @@ -1,113 +1,105 @@ digraph LodgeReservationSystem { - // Graph settings + // Graph attributes rankdir=TB; node [shape=record, fontname="Arial", fontsize=10]; - edge [arrowhead="empty", fontname="Arial", fontsize=9]; + edge [fontname="Arial", fontsize=9]; - // Package clusters + // Package clustering subgraph cluster_data { label="lodge.data"; - style=dashed; - color=blue; + style=filled; + color=lightgrey; - // Account class - Account [label="{Account|+ Account()\l+ Account(String, String, Address, EmailAddress)\l+ Account(String, Address, EmailAddress)\l|+ toString(): String\l+ add(Reservation): boolean\l+ Write(Account): void\l+ getAccount_number(): String\l+ setAccount_number(String): void\l+ getPhone_number(): String\l+ setPhone_number(String): void\l+ getMailing_address(): Address\l+ setMailing_address(Address): void\l+ getEmail_address(): EmailAddress\l+ setEmail_address(EmailAddress): void\l+ findReservation(String): Reservation\l+ update(Account): void\l+ getAllReservations(): ListIterator\\l+ hashCode(): int\l+ equals(Object): boolean\l}"]; + // 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 class - AccountList [label="{AccountList|+ AccountList()\l|+ accountSerial(String, Address, EmailAddress): String\l+ add(Account): boolean\l+ save(Account): void\l+ find(String): Account\l+ getListOfReservations(): List\\l+ showReservationList(): 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}"]; - // AccountReservationList class - AccountReservationList [label="{AccountReservationList|+ AccountReservationList()\l|- reservationSerial(Reservation): String\l|+ add(IReservation): boolean\l+ toString(): String\l+ find(String): Reservation\l+ update(AccountReservationList): void\l}"]; + 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}"]; - // Address class - Address [label="{Address|- Address()\l+ Address(String, String, String, 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+ hashCode(): int\l+ equals(Object): boolean\l+ toString(): String\l}"]; - - // EmailAddress class - EmailAddress [label="{EmailAddress|+ EmailAddress(String)\l|+ getEmail_address(): String\l+ setEmail_address(String): void\l+ hashCode(): int\l+ equals(Object): boolean\l+ toString(): String\l}"]; - - // Exception classes - DuplicateObjectException [label="{DuplicateObjectException|+ DuplicateObjectException()\l+ DuplicateObjectException(String)\l}"]; - IllegalOperationException [label="{IllegalOperationException|+ IllegalOperationException()\l+ IllegalOperationException(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="{«enumeration»\lKitchenTypeEnum|None\lKitchenette\lFullKitchen\l}"]; - ReservationStatusEnum [label="{«enumeration»\lReservationStatusEnum|Draft\lCanceled\lCompleted\l}"]; + KitchenTypeEnum [label="{KitchenTypeEnum|\<\\>|None\lKitchenette\lFullKitchen\l}"]; + + ReservationStatusEnum [label="{ReservationStatusEnum|\<\\>|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_reservation { + label="lodge.reservation"; + style=filled; + color=lightblue; + + // Interface + IReservation [label="{IReservation|\<\\>|+ 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|\<\\>|# 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\|- static reservationSerial(Reservation): String\l+ add(IReservation): boolean\l+ find(String): Reservation\l+ update(AccountReservationList): void\l+ toString(): String\l}"]; + + } } - subgraph cluster_reservation { - label="lodge.reservation"; - style=dashed; - color=green; - - // IReservation interface - IReservation [label="{«interface»\lIReservation|+ ReservationType(): String\l+ copy(String): Reservation\l+ getReservation_number(): String\l+ getAccountNumber(): String\l+ getPhysical_address(): Address\l+ getPricePerNight(): float\l+ calculatePrice(): float\l+ checkValid(): boolean\l}"]; - - // Reservation abstract class - Reservation [label="{«abstract»\lReservation|# Reservation()\l|+ setReservation_number(String): void\l+ getReservation_number(): String\l+ getAccountNumber(): String\l+ setAccountNumber(String): void\l+ setPhysical_address(Address): void\l+ mailing_address(): Address\l+ setMailing_address(Address): void\l+ setReservation_start_date(ZonedDateTime): void\l+ setReservation_end_date(ZonedDateTime): void\l+ setReservation_status(ReservationStatusEnum): void\l+ getKitchen(): KitchenTypeEnum\l+ setKitchen(KitchenTypeEnum): void\l+ setNumberOfBeds(Integer): void\l+ numberOfBedRooms(): Integer\l+ setNumberOfBedRooms(Integer): void\l+ setNumberOfBathRooms(Integer): void\l+ setNumberOfFloors(Integer): void\l+ setSquareFeet(Integer): void\l+ setPrice(Float): void\l+ getType(): char\l+ setType(char): void\l+ getPhysical_address(): Address\l+ getMailing_address(): Address\l+ getReservation_start_date(): ZonedDateTime\l+ getReservation_end_date(): ZonedDateTime\l+ getReservation_status(): ReservationStatusEnum\l+ getNumberOfBeds(): Integer\l+ getNumberOfBedRooms(): Integer\l+ getNumberOfBathRooms(): Integer\l+ getNumberOfFloors(): Integer\l+ getSquareFeet(): Integer\l+ getPrice(): Float\l+ hashCode(): int\l+ equals(Object): boolean\l+ toString(): String\l+ Write(Reservation): void\l+ Change(Reservation, ReservationStatusEnum): void\l+ update(Reservation): void\l+ ReservationType(): String\l}"]; - } + subgraph cluster_reservationsystem { label="lodge.reservationsystem"; - style=dashed; - color=red; + 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}"]; + 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|+ copy(String): Reservation\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|+ 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}"]; - // AccommodationManager class - AccomodationManager [label="{AccomodationManager|- AccomodationManager()\l+ AccomodationManager(String)\l|+ setDataStoreRoot(String): void\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}"]; + AccomodationManager [label="{AccomodationManager|- accounts: AccountList\l|+ AccomodationManager(String)\l+ setDataStoreRoot(String): void\l+ loadAll(): void\l+ load(Path): void\l+ retrieveLoadedAccounts(): List\\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\\l+ showReservationList(): void\l}"]; - // DataRepository class - DataRepository [label="{DataRepository|# getInstance(): DataRepository\l|+ setDataStoreRoot(String): void\l+ getPath(): String\l+ Reservation(String): Reservation\l+ WalkFileSystemTree(AccomodationManager, Path): void\l+ LoadAccount(Path): Account\l- loadReservationRefList(JsonReader, Account): void\l- loadReservation(Account, String, String): void\l}"]; + DataRepository [label="{DataRepository|\<\\>|- 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_main { + subgraph cluster_lodge { label="lodge"; - style=dashed; - color=purple; + style=filled; + color=lightcoral; - TestReservations [label="{TestReservations|+ main(String[]): void\l}"]; - - getRepositoryConfig [label="{getRepositoryConfig|+ getPath(): String\l}"]; + TestReservations [label="{TestReservations|+ static main(String[]): void\l+ static class getRepositoryConfig\l}"]; } // Inheritance relationships - AccountList -> "ArrayList" [arrowhead=empty, style=solid]; - AccountReservationList -> "ArrayList" [arrowhead=empty, style=solid]; Reservation -> IReservation [arrowhead=empty, style=dashed, label="implements"]; - CabinReservation -> Reservation [arrowhead=empty, style=solid]; - HotelReservation -> Reservation [arrowhead=empty, style=solid]; - HouseReservation -> Reservation [arrowhead=empty, style=solid]; - DuplicateObjectException -> RuntimeException [arrowhead=empty, style=solid]; - IllegalOperationException -> RuntimeException [arrowhead=empty, style=solid]; + CabinReservation -> Reservation [arrowhead=empty, label="extends"]; + HotelReservation -> Reservation [arrowhead=empty, label="extends"]; + HouseReservation -> Reservation [arrowhead=empty, label="extends"]; - // Composition relationships (filled diamond) - Account -> AccountReservationList [arrowhead=none, arrowtail=diamond, style=solid, label="1"]; - Account -> Address [arrowhead=none, arrowtail=diamond, style=solid, label="2"]; - Account -> EmailAddress [arrowhead=none, arrowtail=diamond, style=solid, label="1"]; - AccomodationManager -> AccountList [arrowhead=none, arrowtail=odiamond, style=solid, label="1"]; + // 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=diamond, label="contains"]; + 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"]; - // Aggregation relationships (empty diamond) - AccountList -> Account [arrowhead=none, arrowtail=odiamond, style=solid, label="*"]; - AccountReservationList -> IReservation [arrowhead=empty, arrowtail=odiamond, style=solid, label="0..*"]; - - // Association relationships - Reservation -> Address [arrowhead=none, style=solid, label="uses"]; - Reservation -> KitchenTypeEnum [arrowhead=none, style=solid, label="uses"]; - Reservation -> ReservationStatusEnum [arrowhead=none, style=solid, label="uses"]; - AccomodationManager -> Account [arrowhead=none, arrowtail=odiamond, label="manages"]; - AccomodationManager -> Reservation [arrowhead=none, style=dashed, label="manages"]; - DataRepository -> AccomodationManager [arrowhead=none, style=dashed, label="uses"]; - TestReservations -> AccomodationManager [arrowhead=none, style=dashed, label="uses"]; - TestReservations -> getRepositoryConfig [arrowhead=none, style=dashed, label="uses"]; - - // Dependency relationships - Account -> DuplicateObjectException [arrowhead=open, style=dashed, label="throws"]; - AccountList -> DuplicateObjectException [arrowhead=open, style=dashed, label="throws"]; + // 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"]; -} \ No newline at end of file +} diff --git a/uml/classdiagram.svg b/uml/classdiagram.svg index c55331f..b84b774 100644 --- a/uml/classdiagram.svg +++ b/uml/classdiagram.svg @@ -4,504 +4,466 @@ - - + + LodgeReservationSystem - - -cluster_reservationsystem - -lodge.reservationsystem + + +cluster_lodge + +lodge cluster_data - -lodge.data - - -cluster_main - -lodge + +lodge.data cluster_reservation - -lodge.reservation + +lodge.reservation + + +cluster_reservationsystem + +lodge.reservationsystem Account - -Account - -+ Account() -+ Account(String, String, Address, EmailAddress) -+ Account(String, Address, EmailAddress) - -+ toString(): String -+ add(Reservation): boolean -+ Write(Account): void -+ getAccount_number(): String -+ setAccount_number(String): void -+ getPhone_number(): String -+ setPhone_number(String): void -+ getMailing_address(): Address -+ setMailing_address(Address): void -+ getEmail_address(): EmailAddress -+ setEmail_address(EmailAddress): void -+ findReservation(String): Reservation -+ update(Account): void -+ getAllReservations(): ListIterator<IReservation> -+ hashCode(): int -+ equals(Object): boolean - - - -AccountReservationList - -AccountReservationList - -+ AccountReservationList() - -- reservationSerial(Reservation): String - -+ add(IReservation): boolean -+ toString(): String -+ find(String): Reservation -+ update(AccountReservationList): void - - - -Account->AccountReservationList - -1 + +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 - -- Address() -+ Address(String, String, String, String) - -+ getStreet(): String -+ setStreet(String): void -+ getCity(): String -+ setCity(String): void -+ getState(): String -+ setState(String): void -+ getZip(): String -+ setZip(String): void -+ hashCode(): int -+ equals(Object): boolean -+ toString(): String + +Address + ++ street: String ++ city: String ++ state: String ++ zip: String + ++ Address(String, String, String, String) ++ getters/setters ++ hashCode(): int ++ equals(Object): boolean ++ toString(): String - + Account->Address - -2 + + +mailing_address - + EmailAddress - -EmailAddress - -+ 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 - -1 + + +email_address - - -DuplicateObjectException - -DuplicateObjectException - -+ DuplicateObjectException() -+ DuplicateObjectException(String) + + +AccountReservationList + +AccountReservationList + +extends ArrayList<IReservation> + +- static reservationSerial(Reservation): String ++ add(IReservation): boolean ++ find(String): Reservation ++ update(AccountReservationList): void ++ toString(): String - - -Account->DuplicateObjectException - - -throws + + +Account->AccountReservationList + + +contains AccountList - -AccountList - -+ AccountList() - -+ accountSerial(String, Address, EmailAddress): 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 - -* - - - -AccountList->DuplicateObjectException - - -throws - - - -ArrayList<Account> - -ArrayList<Account> - - - -AccountList->ArrayList<Account> - - - - - -AccountReservationList->DuplicateObjectException - - -throws - - - -IReservation - -«interface» -IReservation - -+ ReservationType(): String -+ copy(String): Reservation -+ getReservation_number(): String -+ getAccountNumber(): String -+ getPhysical_address(): Address -+ getPricePerNight(): float -+ calculatePrice(): float -+ checkValid(): boolean - - - -AccountReservationList->IReservation - -* - - - -ArrayList<IReservation> - -ArrayList<IReservation> - - - -AccountReservationList->ArrayList<IReservation> - - - - - -RuntimeException - -RuntimeException - - - -DuplicateObjectException->RuntimeException - - - - - -IllegalOperationException - -IllegalOperationException - -+ IllegalOperationException() -+ IllegalOperationException(String) - - -IllegalOperationException->RuntimeException - - +AccountList->Account + + +contains - + KitchenTypeEnum - -«enumeration» -KitchenTypeEnum - -None -Kitchenette -FullKitchen + +KitchenTypeEnum + +<<enumeration>> + +None +Kitchenette +FullKitchen - + ReservationStatusEnum - -«enumeration» -ReservationStatusEnum - -Draft -Canceled -Completed + +ReservationStatusEnum + +<<enumeration>> + +Draft +Canceled +Completed + + + +DuplicateObjectException + +DuplicateObjectException + +extends RuntimeException + ++ DuplicateObjectException() ++ DuplicateObjectException(String) + + + +IllegalOperationException + +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 - + Reservation - -«abstract» -Reservation - -# Reservation() - -+ setReservation_number(String): void -+ getReservation_number(): String -+ getAccountNumber(): String -+ setAccountNumber(String): void -+ setPhysical_address(Address): void -+ mailing_address(): Address -+ setMailing_address(Address): void -+ setReservation_start_date(ZonedDateTime): void -+ setReservation_end_date(ZonedDateTime): void -+ setReservation_status(ReservationStatusEnum): void -+ getKitchen(): KitchenTypeEnum -+ setKitchen(KitchenTypeEnum): void -+ setNumberOfBeds(Integer): void -+ numberOfBedRooms(): Integer -+ setNumberOfBedRooms(Integer): void -+ setNumberOfBathRooms(Integer): void -+ setNumberOfFloors(Integer): void -+ setSquareFeet(Integer): void -+ setPrice(Float): void -+ getType(): char -+ setType(char): void -+ getPhysical_address(): Address -+ getMailing_address(): Address -+ getReservation_start_date(): ZonedDateTime -+ getReservation_end_date(): ZonedDateTime -+ getReservation_status(): ReservationStatusEnum -+ getNumberOfBeds(): Integer -+ getNumberOfBedRooms(): Integer -+ getNumberOfBathRooms(): Integer -+ getNumberOfFloors(): Integer -+ getSquareFeet(): Integer -+ getPrice(): Float -+ hashCode(): int -+ equals(Object): boolean -+ toString(): String -+ Write(Reservation): void -+ Change(Reservation, ReservationStatusEnum): void -+ update(Reservation): void -+ 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 - -uses - - - -Reservation->IllegalOperationException - - -throws + + +physical_address +mailing_address - + Reservation->KitchenTypeEnum - -uses + + +kitchen - + Reservation->ReservationStatusEnum - -uses + + +reservation_status + + + +Reservation->IllegalOperationException + + +throws - + Reservation->IReservation - - -implements + + +implements + + + +AccountReservationList->DuplicateObjectException + + +throws + + + +AccountReservationList->IReservation + + +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 HotelReservation - -HotelReservation - -+ HotelReservation() -+ HotelReservation(Address) - -+ 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 HouseReservation - -HouseReservation - -+ HouseReservation() -+ HouseReservation(Address) - -+ 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 AccomodationManager - -AccomodationManager - -- AccomodationManager() -+ AccomodationManager(String) - -+ setDataStoreRoot(String): void -+ loadAll(): void -+ load(Path): void -+ retrieveLoadedAccounts(): List<Account> -+ retrieveAccount(String): Account -+ AddAccount(Account): void -+ UpdateAccount(Account): void -+ newAccount(String, Address, EmailAddress): Account -+ addReservation(Account, Reservation): boolean -+ findReservation(String): Reservation -+ getReservationList(): List<? extends IReservation> -+ showReservationList(): void - - - -AccomodationManager->Account - -manages + +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 - -1 - - - -AccomodationManager->Reservation - -manages + + +accounts DataRepository - -DataRepository - -# getInstance(): DataRepository - -+ setDataStoreRoot(String): void -+ getPath(): String -+ Reservation(String): Reservation -+ WalkFileSystemTree(AccomodationManager, Path): void -+ LoadAccount(Path): Account -- loadReservationRefList(JsonReader, Account): void -- loadReservation(Account, String, String): void + +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->AccomodationManager - -uses + + +AccomodationManager->DataRepository + + +uses + + + +DataRepository->Account + + +creates + + + +DataRepository->CabinReservation + + +creates + + + +DataRepository->HotelReservation + + +creates + + + +DataRepository->HouseReservation + + +creates TestReservations - -TestReservations - -+ main(String[]): void + +TestReservations + ++ static main(String[]): void ++ static class getRepositoryConfig + + + +TestReservations->CabinReservation + + +creates + + + +TestReservations->HotelReservation + + +creates + + + +TestReservations->HouseReservation + + +creates - + TestReservations->AccomodationManager - -uses - - - -getRepositoryConfig - -getRepositoryConfig - -+ getPath(): String - - - -TestReservations->getRepositoryConfig - -uses + + +uses