diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..7e257db --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,3 @@ +{ + "recommendations": [] +} \ No newline at end of file diff --git a/README.md b/README.md index e066eae..b8f5e21 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,6 @@ | Language Support for Java(TM) by Red Hat | ### Run and Debug Java manually - cd to: libs java -cp .\libs\gson-2.13.1.jar;.\libs\reservationsystem.jar lodge.TestReservations @@ -23,5 +22,7 @@ java -cp .\libs\gson-2.13.1.jar;.\libs\reservationsystem.jar lodge.TestReservati ### create jar archive: gradle clean build jar +### Dot file review for classdiagram +### dot -Tsvg classdiagram.dot -o classdiagram.svg diff --git a/sdd/Software Detail Design Template.docx b/sdd/Software Detail Design Template.docx new file mode 100644 index 0000000..c72fc34 Binary files /dev/null and b/sdd/Software Detail Design Template.docx differ diff --git a/src/java/lodge/data/Account.java b/src/java/lodge/data/Account.java index 633d0b5..4fd6ea9 100644 --- a/src/java/lodge/data/Account.java +++ b/src/java/lodge/data/Account.java @@ -14,6 +14,7 @@ import java.nio.file.Paths; import java.util.ListIterator; import lodge.reservation.Reservation; +import lodge.reservationsystem.DataRepository; import lodge.reservation.IReservation; public class Account { @@ -23,7 +24,7 @@ public class Account { private EmailAddress email_address; private final AccountReservationList reservations = new AccountReservationList(); - protected Account() { + public Account() { } diff --git a/src/java/lodge/reservation/Reservation.java b/src/java/lodge/reservation/Reservation.java index 0bec625..077a814 100644 --- a/src/java/lodge/reservation/Reservation.java +++ b/src/java/lodge/reservation/Reservation.java @@ -13,10 +13,10 @@ import java.nio.file.Paths; import java.time.ZonedDateTime; import lodge.data.Address; -import lodge.data.DataRepository; import lodge.data.IllegalOperationException; import lodge.data.KitchenTypeEnum; import lodge.data.ReservationStatusEnum; +import lodge.reservationsystem.DataRepository; public abstract class Reservation implements IReservation{ private char type; diff --git a/src/java/lodge/reservationsystem/AccomodationManager.java b/src/java/lodge/reservationsystem/AccomodationManager.java index 5dfb3dc..5029af6 100644 --- a/src/java/lodge/reservationsystem/AccomodationManager.java +++ b/src/java/lodge/reservationsystem/AccomodationManager.java @@ -12,7 +12,6 @@ import java.util.List; import lodge.data.Account; import lodge.data.AccountList; import lodge.data.Address; -import lodge.data.DataRepository; import lodge.data.EmailAddress; import lodge.reservation.Reservation; import lodge.reservation.IReservation; diff --git a/src/java/lodge/data/DataRepository.java b/src/java/lodge/reservationsystem/DataRepository.java similarity index 98% rename from src/java/lodge/data/DataRepository.java rename to src/java/lodge/reservationsystem/DataRepository.java index 31ed85e..02cbd64 100644 --- a/src/java/lodge/data/DataRepository.java +++ b/src/java/lodge/reservationsystem/DataRepository.java @@ -2,7 +2,7 @@ * license: GPLv3 * lodge.reservationsystem */ -package lodge.data; +package lodge.reservationsystem; import java.io.BufferedReader; import java.io.FileReader; @@ -17,13 +17,13 @@ import java.nio.file.attribute.BasicFileAttributes; import java.time.ZonedDateTime; import com.google.gson.stream.JsonReader; +import lodge.data.Address; +import lodge.data.EmailAddress; +import lodge.data.Account; +import lodge.data.KitchenTypeEnum; +import lodge.data.ReservationStatusEnum; import lodge.reservation.Reservation; -import lodge.reservationsystem.AccomodationManager; -import lodge.reservationsystem.CabinReservation; -import lodge.reservationsystem.HotelReservation; -import lodge.reservationsystem.HouseReservation; - public final class DataRepository { // SINGLETON CLASS // hard code data store location for storage of diff --git a/uml/classdiagram.dot b/uml/classdiagram.dot index b8208af..81423cf 100644 --- a/uml/classdiagram.dot +++ b/uml/classdiagram.dot @@ -1,293 +1,113 @@ digraph LodgeReservationSystem { + // Graph settings rankdir=TB; - node [shape=record, style=filled, fillcolor=lightyellow]; - edge [arrowhead=empty]; - - // Data Package 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(account_number, phone_number, mailing_address, email_address)\l - + Account(phone_number, mailing_address, email_address)\l - + toString(): String\l - + add(rsrv: Reservation): boolean\l - + Write(acct: Account): void\l - + getAccount_number(): String\l - + setAccount_number(account_number: String): void\l - + getPhone_number(): String\l - + setPhone_number(phone_number: String): void\l - + getMailing_address(): Address\l - + setMailing_address(mailing_address: Address): void\l - + getEmail_address(): EmailAddress\l - + setEmail_address(email_address: EmailAddress): void\l - + hashCode(): int\l - + findReservation(reservation_number: String): Reservation\l - + equals(obj: Object): boolean\l - + update(acct: Account): void\l - + getAllReservations(): ListIterator\\l - }"] - - AccountList [label="{AccountList| - | - + accountSerial(phone_number, mailing_address, email_address): String\l - + add(account: Account): boolean\l - + save(acct: Account): void\l - + find(account_number: String): Account\l - + getListOfReservations(): List\\l - + showReservationList(): void\l - }"] - - AccountReservationList [label="{AccountReservationList| - | - - reservationSerial(reservation: Reservation): String\l - + add(reservation: IReservation): boolean\l - + toString(): String\l - + find(reservation_number: String): Reservation\l - + update(incoming_reservation_list: AccountReservationList): void\l - }"] - - Address [label="{Address| - - street: String\l - - city: String\l - - state: String\l - - zip: String\l| - + Address(street, city, state, zip)\l - + getStreet(): String\l - + setStreet(street: String): void\l - + getCity(): String\l - + setCity(city: String): void\l - + getState(): String\l - + setState(state: String): void\l - + getZip(): String\l - + setZip(zip: String): void\l - + hashCode(): int\l - + equals(obj: Object): boolean\l - + toString(): String\l - }"] - - EmailAddress [label="{EmailAddress| - - email_address: String\l| - + EmailAddress(email_address: String)\l - + getEmail_address(): String\l - + setEmail_address(email_address: String): void\l - + hashCode(): int\l - + equals(obj: Object): boolean\l - + toString(): String\l - }"] - - DataRepository [label="{DataRepository| - - directoryPath: String\l - - instance: DataRepository\l| - # getInstance(): DataRepository\l - + setDataStoreRoot(directoryPath: String): void\l - + getPath(): String\l - + Reservation(type: String): Reservation\l - + WalkFileSystemTree(manager: AccomodationManager, rootDir: Path): void\l - + LoadAccount(file: Path): Account\l - - loadReservationRefList(rdr: JsonReader, ac: Account): void\l - - loadReservation(ac: Account, reservationType: String, reservationNumber: String): void\l - }"] - - // Enums - KitchenTypeEnum [label="{«enumeration»\nKitchenTypeEnum| - None\l - Kitchenette\l - FullKitchen\l - }", fillcolor=lightblue] - - ReservationStatusEnum [label="{«enumeration»\nReservationStatusEnum| - Draft\l - Canceled\l - Completed\l - }", fillcolor=lightblue] - - // Exceptions - DuplicateObjectException [label="{DuplicateObjectException| - | - + DuplicateObjectException()\l - + DuplicateObjectException(message: String)\l - }", fillcolor=lightcoral] - - IllegalOperationException [label="{IllegalOperationException| - | - + IllegalOperationException()\l - + IllegalOperationException(message: String)\l - }", fillcolor=lightcoral] - - // Reservation Package - IReservation [label="{«interface»\nIReservation| - | - + ReservationType(): String\l - + copy(type: String): Reservation\l - + getReservation_number(): String\l - + getAccountNumber(): String\l - + getPhysical_address(): Address\l - + getPricePerNight(): float\l - + calculatePrice(): float\l - + checkValid(): boolean\l - }", fillcolor=lightgreen] - - Reservation [label="{«abstract»\nReservation| - - 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 - + setReservation_number(reservation_number: String): void\l - + getReservation_number(): String\l - + getAccountNumber(): String\l - + setAccountNumber(account_number: String): void\l - + setPhysical_address(physical_address: Address): void\l - + getPhysical_address(): Address\l - + getMailing_address(): Address\l - + setMailing_address(mailing_address: Address): void\l - + setReservation_start_date(reservation_start_date: ZonedDateTime): void\l - + getReservation_start_date(): ZonedDateTime\l - + setReservation_end_date(reservation_end_date: ZonedDateTime): void\l - + getReservation_end_date(): ZonedDateTime\l - + setReservation_status(reservation_status: ReservationStatusEnum): void\l - + getReservation_status(): ReservationStatusEnum\l - + getKitchen(): KitchenTypeEnum\l - + setKitchen(kitchen: KitchenTypeEnum): void\l - + setNumberOfBeds(numberOfBeds: Integer): void\l - + getNumberOfBeds(): Integer\l - + numberOfBedRooms(): Integer\l - + setNumberOfBedRooms(numberOfBedRooms: Integer): void\l - + getNumberOfBedRooms(): Integer\l - + setNumberOfBathRooms(numberOfBathRooms: Integer): void\l - + getNumberOfBathRooms(): Integer\l - + setNumberOfFloors(numberOfFloors: Integer): void\l - + getNumberOfFloors(): Integer\l - + setSquareFeet(squareFeet: Integer): void\l - + getSquareFeet(): Integer\l - + setPrice(price: Float): void\l - + getPrice(): Float\l - + getType(): char\l - + setType(type: char): void\l - + hashCode(): int\l - + equals(obj: Object): boolean\l - + toString(): String\l - + Write(reservation: Reservation): void\l - + Change(reservation: Reservation, newStatus: ReservationStatusEnum): void\l - + update(rsrv: Reservation): void\l - + {abstract} ReservationType(): String\l - }", fillcolor=lightgray] - - // ReservationSystem Package - AccomodationManager [label="{AccomodationManager| - - accounts: AccountList\l| - + AccomodationManager(home: String)\l - + setDataStoreRoot(home: String): void\l - + loadAll(): void\l - + load(file: Path): void\l - + retrieveLoadedAccounts(): List\\l - + retrieveAccount(acct_id: String): Account\l - + AddAccount(acct: Account): void\l - + UpdateAccount(acct: Account): void\l - + newAccount(phone_number, mailing_address, email_address): Account\l - + addReservation(account: Account, reservation: Reservation): boolean\l - + findReservation(reservation_number: String): Reservation\l - + getReservationList(): List\\l - + showReservationList(): void\l - }"] - - HotelReservation [label="{HotelReservation| - | - + HotelReservation()\l - + HotelReservation(physical_address: Address)\l - + copy(reservationType: String): Reservation\l - + ReservationType(): String\l - + checkValid(): boolean\l - + getPricePerNight(): float\l - + calculatePrice(): float\l - }"] - - HouseReservation [label="{HouseReservation| - | - + HouseReservation()\l - + HouseReservation(physical_address: Address)\l - + copy(reservationType: String): Reservation\l - + ReservationType(): String\l - + checkValid(): boolean\l - + getPricePerNight(): float\l - + calculatePrice(): float\l - }"] - - CabinReservation [label="{CabinReservation| - | - + CabinReservation()\l - + CabinReservation(physical_address: Address)\l - + ReservationType(): String\l - + checkValid(): boolean\l - + getPricePerNight(): float\l - + calculatePrice(): float\l - }"] - - TestReservations [label="{TestReservations| - | - + main(args: String[]): void\l - }"] - - getRepositoryConfig [label="{getRepositoryConfig| - | - + getPath(): String\l - }"] - - // Base class relationships - RuntimeException [label="RuntimeException", fillcolor=white] - ArrayList [label="ArrayList\", fillcolor=white] - + node [shape=record, fontname="Arial", fontsize=10]; + edge [arrowhead="empty", fontname="Arial", fontsize=9]; + + // Package clusters + subgraph cluster_data { + label="lodge.data"; + style=dashed; + color=blue; + + // 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}"]; + + // 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}"]; + + // 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 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}"]; + + // Enums + KitchenTypeEnum [label="{«enumeration»\lKitchenTypeEnum|None\lKitchenette\lFullKitchen\l}"]; + ReservationStatusEnum [label="{«enumeration»\lReservationStatusEnum|Draft\lCanceled\lCompleted\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; + + // Concrete reservation classes + 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}"]; + + HouseReservation [label="{HouseReservation|+ HouseReservation()\l+ HouseReservation(Address)\l|+ 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}"]; + + // 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}"]; + } + + subgraph cluster_main { + label="lodge"; + style=dashed; + color=purple; + + TestReservations [label="{TestReservations|+ main(String[]): void\l}"]; + + getRepositoryConfig [label="{getRepositoryConfig|+ getPath(): String\l}"]; + } + // Inheritance relationships - AccountList -> ArrayList [arrowhead=empty] - AccountReservationList -> ArrayList [arrowhead=empty] - DuplicateObjectException -> RuntimeException [arrowhead=empty] - IllegalOperationException -> RuntimeException [arrowhead=empty] + 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]; - // Interface implementation - Reservation -> IReservation [arrowhead=empty, style=dashed] + // 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"]; - // Class inheritance - HotelReservation -> Reservation [arrowhead=empty] - HouseReservation -> Reservation [arrowhead=empty] - CabinReservation -> Reservation [arrowhead=empty] - - // Composition relationships - Account -> AccountReservationList [arrowhead=diamond, label="1"] - Account -> Address [arrowhead=diamond, label="1"] - Account -> EmailAddress [arrowhead=diamond, label="1"] - - // Aggregation relationships - AccomodationManager -> AccountList [arrowhead=odiamond, label="1"] - AccountList -> Account [arrowhead=odiamond, label="*"] - AccountReservationList -> IReservation [arrowhead=odiamond, label="0...*"] + // 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=vee, label="uses", style=dashed] - Reservation -> ReservationStatusEnum [arrowhead=vee, label="uses", style=dashed] - Reservation -> KitchenTypeEnum [arrowhead=vee, label="uses", style=dashed] + 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 - DataRepository -> AccomodationManager [arrowhead=vee, style=dashed, label="uses"] - DataRepository -> Account [arrowhead=vee, style=dashed, label="creates"] - DataRepository -> Reservation [arrowhead=vee, style=dashed, label="creates"] - TestReservations -> AccomodationManager [arrowhead=vee, style=dashed, label="uses"] - TestReservations -> getRepositoryConfig [arrowhead=vee, style=dashed, label="uses"] - - // Singleton pattern - DataRepository -> DataRepository [arrowhead=vee, style=dashed, label="singleton"] + Account -> DuplicateObjectException [arrowhead=open, style=dashed, label="throws"]; + AccountList -> DuplicateObjectException [arrowhead=open, style=dashed, label="throws"]; + 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 f38e095..c55331f 100644 --- a/uml/classdiagram.svg +++ b/uml/classdiagram.svg @@ -1,453 +1,507 @@ - - - + + LodgeReservationSystem - + + +cluster_reservationsystem + +lodge.reservationsystem + + +cluster_data + +lodge.data + + +cluster_main + +lodge + + +cluster_reservation + +lodge.reservation + Account - -Account - -- account_number: String - - phone_number: String - - mailing_address: Address - - email_address: EmailAddress - - reservations: AccountReservationList - -+ Account() - + Account(account_number, phone_number, mailing_address, email_address) - + Account(phone_number, mailing_address, email_address) - + toString(): String - + add(rsrv: Reservation): boolean - + Write(acct: Account): void - + getAccount_number(): String - + setAccount_number(account_number: String): void - + getPhone_number(): String - + setPhone_number(phone_number: String): void - + getMailing_address(): Address - + setMailing_address(mailing_address: Address): void - + getEmail_address(): EmailAddress - + setEmail_address(email_address: EmailAddress): void - + hashCode(): int - + findReservation(reservation_number: String): Reservation - + equals(obj: Object): boolean - + update(acct: Account): void - + getAllReservations(): ListIterator<IReservation> + +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 - - - -- reservationSerial(reservation: Reservation): String - + add(reservation: IReservation): boolean - + toString(): String - + find(reservation_number: String): Reservation - + update(incoming_reservation_list: AccountReservationList): void + +AccountReservationList + ++ AccountReservationList() + +- reservationSerial(Reservation): String + ++ add(IReservation): boolean ++ toString(): String ++ find(String): Reservation ++ update(AccountReservationList): void Account->AccountReservationList - - -1 + +1 Address - -Address - -- street: String - - city: String - - state: String - - zip: String - -+ Address(street, city, state, zip) - + getStreet(): String - + setStreet(street: String): void - + getCity(): String - + setCity(city: String): void - + getState(): String - + setState(state: String): void - + getZip(): String - + setZip(zip: String): void - + hashCode(): int - + equals(obj: Object): boolean - + toString(): String + +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 Account->Address - - -1 + +2 EmailAddress - -EmailAddress - -- email_address: String - -+ EmailAddress(email_address: String) - + getEmail_address(): String - + setEmail_address(email_address: String): void - + hashCode(): int - + equals(obj: Object): boolean - + toString(): String + +EmailAddress + ++ EmailAddress(String) + ++ getEmail_address(): String ++ setEmail_address(String): void ++ hashCode(): int ++ equals(Object): boolean ++ toString(): String Account->EmailAddress - - -1 + +1 + + + +DuplicateObjectException + +DuplicateObjectException + ++ DuplicateObjectException() ++ DuplicateObjectException(String) + + + +Account->DuplicateObjectException + + +throws AccountList - -AccountList - - - -+ accountSerial(phone_number, mailing_address, email_address): String - + add(account: Account): boolean - + save(acct: Account): void - + find(account_number: String): Account - + getListOfReservations(): List<? extends IReservation> - + showReservationList(): void + +AccountList + ++ AccountList() + ++ accountSerial(String, Address, EmailAddress): String ++ add(Account): boolean ++ save(Account): void ++ find(String): Account ++ getListOfReservations(): List<? extends IReservation> ++ showReservationList(): void AccountList->Account - - -* + +* - - -ArrayList - -ArrayList<T> + + +AccountList->DuplicateObjectException + + +throws - + + +ArrayList<Account> + +ArrayList<Account> + + -AccountList->ArrayList - - +AccountList->ArrayList<Account> + + + + + +AccountReservationList->DuplicateObjectException + + +throws - + IReservation - -«interface» -IReservation - - - -+ ReservationType(): String - + copy(type: String): Reservation - + getReservation_number(): String - + getAccountNumber(): String - + getPhysical_address(): Address - + getPricePerNight(): float - + calculatePrice(): float - + checkValid(): boolean + +«interface» +IReservation + ++ ReservationType(): String ++ copy(String): Reservation ++ getReservation_number(): String ++ getAccountNumber(): String ++ getPhysical_address(): Address ++ getPricePerNight(): float ++ calculatePrice(): float ++ checkValid(): boolean AccountReservationList->IReservation - - -0...* + +* - + + +ArrayList<IReservation> + +ArrayList<IReservation> + + -AccountReservationList->ArrayList - - - - - -DataRepository - -DataRepository - -- directoryPath: String - - instance: DataRepository - -# getInstance(): DataRepository - + setDataStoreRoot(directoryPath: String): void - + getPath(): String - + Reservation(type: String): Reservation - + WalkFileSystemTree(manager: AccomodationManager, rootDir: Path): void - + LoadAccount(file: Path): Account - - loadReservationRefList(rdr: JsonReader, ac: Account): void - - loadReservation(ac: Account, reservationType: String, reservationNumber: String): void - - - -DataRepository->Account - - -creates - - - -DataRepository->DataRepository - - -singleton - - - -Reservation - -Reservation - - - -DataRepository->Reservation - - -creates - - - -AccomodationManager - -AccomodationManager - -- accounts: AccountList - -+ AccomodationManager(home: String) - + setDataStoreRoot(home: String): void - + loadAll(): void - + load(file: Path): void - + retrieveLoadedAccounts(): List<Account> - + retrieveAccount(acct_id: String): Account - + AddAccount(acct: Account): void - + UpdateAccount(acct: Account): void - + newAccount(phone_number, mailing_address, email_address): Account - + addReservation(account: Account, reservation: Reservation): boolean - + findReservation(reservation_number: String): Reservation - + getReservationList(): List<? extends IReservation> - + showReservationList(): void - - - -DataRepository->AccomodationManager - - -uses - - - -KitchenTypeEnum - -«enumeration» -KitchenTypeEnum - -None - Kitchenette - FullKitchen - - - -ReservationStatusEnum - -«enumeration» -ReservationStatusEnum - -Draft - Canceled - Completed - - - -DuplicateObjectException - -DuplicateObjectException - - - -+ DuplicateObjectException() - + DuplicateObjectException(message: String) +AccountReservationList->ArrayList<IReservation> + + - + RuntimeException - -RuntimeException + +RuntimeException - + DuplicateObjectException->RuntimeException - - + + - + IllegalOperationException - -IllegalOperationException - - - -+ IllegalOperationException() - + IllegalOperationException(message: String) + +IllegalOperationException + ++ IllegalOperationException() ++ IllegalOperationException(String) - + IllegalOperationException->RuntimeException - - + + + + + +KitchenTypeEnum + +«enumeration» +KitchenTypeEnum + +None +Kitchenette +FullKitchen + + + +ReservationStatusEnum + +«enumeration» +ReservationStatusEnum + +Draft +Canceled +Completed + + + +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->Address - - -uses + +uses + + + +Reservation->IllegalOperationException + + +throws - + Reservation->KitchenTypeEnum - - -uses + +uses - + Reservation->ReservationStatusEnum - - -uses + +uses - + Reservation->IReservation - - + + +implements + + + +CabinReservation + +CabinReservation + ++ CabinReservation() ++ CabinReservation(Address) + ++ ReservationType(): String ++ checkValid(): boolean ++ getPricePerNight(): float ++ calculatePrice(): float + + + +CabinReservation->Reservation + + + + + +HotelReservation + +HotelReservation + ++ HotelReservation() ++ HotelReservation(Address) + ++ copy(String): Reservation ++ ReservationType(): String ++ checkValid(): boolean ++ getPricePerNight(): float ++ calculatePrice(): float + + + +HotelReservation->Reservation + + + + + +HouseReservation + +HouseReservation + ++ HouseReservation() ++ HouseReservation(Address) + ++ copy(String): Reservation ++ ReservationType(): String ++ checkValid(): boolean ++ getPricePerNight(): float ++ calculatePrice(): float + + + +HouseReservation->Reservation + + + + + +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->AccountList - - -1 + +1 - - -HotelReservation - -HotelReservation - - - -+ HotelReservation() - + HotelReservation(physical_address: Address) - + copy(reservationType: String): Reservation - + ReservationType(): String - + checkValid(): boolean - + getPricePerNight(): float - + calculatePrice(): float + + +AccomodationManager->Reservation + +manages - - -HotelReservation->Reservation - - - - - -HouseReservation - -HouseReservation - - - -+ HouseReservation() - + HouseReservation(physical_address: Address) - + copy(reservationType: String): Reservation - + ReservationType(): String - + checkValid(): boolean - + getPricePerNight(): float - + calculatePrice(): float - - - -HouseReservation->Reservation - - - - + -CabinReservation - -CabinReservation - - - -+ CabinReservation() - + CabinReservation(physical_address: Address) - + ReservationType(): String - + checkValid(): boolean - + getPricePerNight(): float - + calculatePrice(): float +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 - - -CabinReservation->Reservation - - + + +DataRepository->AccomodationManager + +uses TestReservations - -TestReservations - - - -+ main(args: String[]): void + +TestReservations + ++ main(String[]): void TestReservations->AccomodationManager - - -uses + +uses getRepositoryConfig - -getRepositoryConfig - - - -+ getPath(): String + +getRepositoryConfig + ++ getPath(): String TestReservations->getRepositoryConfig - - -uses + +uses