diff --git a/sdd/Software_Detail_Design.docx b/sdd/Software_Detail_Design.docx index d420704..e329f7a 100644 Binary files a/sdd/Software_Detail_Design.docx and b/sdd/Software_Detail_Design.docx differ diff --git a/uml/classdiagram.dot b/uml/classdiagram.dot new file mode 100644 index 0000000..8aa62f5 --- /dev/null +++ b/uml/classdiagram.dot @@ -0,0 +1,111 @@ +digraph LodgeReservationSystem { + // Graph attributes + rankdir=TB; + node [shape=record, fontname="Arial", fontsize=10]; + edge [fontname="Arial", fontsize=9]; + + // Package clustering + subgraph cluster_data { + label="lodge.data"; + style=filled; + color=lightgrey; + + // 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}"]; + + // Enums + 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_account { + label="lodge.reservation"; + style=filled; + color="#e9d5ba"; + 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; + 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_reservationsystem { + label="lodge.reservationsystem"; + 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}"]; + + 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+ static copy(String): Reservation\l+ ReservationType(): String\l+ checkValid(): boolean\l+ getPricePerNight(): float\l+ calculatePrice(): float\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 [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_lodge { + label="lodge"; + style=filled; + color=lightcoral; + + TestReservations [label="{TestReservations|+ static main(String[]): void\l+ static class getRepositoryConfig\l}"]; + } + + // Inheritance relationships + Reservation -> IReservation [arrowhead=empty, style=dashed, label="implements"]; + CabinReservation -> Reservation [arrowhead=empty, label="extends"]; + HotelReservation -> Reservation [arrowhead=empty, label="extends"]; + HouseReservation -> Reservation [arrowhead=empty, label="extends"]; + + // 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=odiamond, label="contains 0..*"]; + 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"]; + + // 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"]; +} diff --git a/uml/classdiagram1.dot b/uml/classdiagram1.dot new file mode 100644 index 0000000..7828047 --- /dev/null +++ b/uml/classdiagram1.dot @@ -0,0 +1,110 @@ +digraph ClassDiagram { + graph [ + rankdir="TB", + splines=ortho, + nodesep=1.0, + ranksep=1.2 + ]; + node [ + shape=record, + style=filled, + fillcolor=lightyellow, + fontname="Helvetica,Arial,sans-serif" + ]; + edge [ + fontname="Helvetica,Arial,sans-serif" + ]; + + // --- Interfaces --- + IReservation [ + label="{interface\nIReservation|+ ReservationType(): String\l+ checkValid(): boolean\l+ calculatePrice(): float\l+ getReservation_number(): String\l+ getPhysical_address(): Address\l+ getAccountNumber(): String\l}", + fillcolor=palegreen + ]; + + // --- Abstract Classes --- + Reservation [ + label="{abstract\nReservation|+ {abstract} ReservationType(): String\l+ Write(Reservation): void\l+ Change(Reservation, ReservationStatusEnum): void\l+ update(Reservation): void\l+ calculatePrice(): float\l+ setMailing_address(Address): void\l+ setNumberOfBeds(int): void\l+ setNumberOfFloors(int): void\l+ setNumberOfBedRooms(int): void\l+ setSquareFeet(int): void\l+ setReservation_start_date(ZonedDateTime): void\l+ setReservation_end_date(ZonedDateTime): void\l}", + fontstyle=italic + ]; + + // --- Concrete Classes --- + AccomodationManager [ + label="{AccomodationManager|+ AccomodationManager(String)\l+ loadAll(): void\l+ retrieveAccount(String): Account\l+ retrieveLoadedAccounts(): AccountList\l+ newAccount(String, Address, EmailAddress): Account\l+ AddAccount(Account): void\l+ UpdateAccount(Account): void\l+ addReservation(Account, Reservation): boolean\l+ showReservationList(): void\l}" + ]; + + DataRepository [ + label="{DataRepository (Singleton)|+ {static} getInstance(): DataRepository\l+ {static} setDataStoreRoot(String): void\l+ {static} WalkFileSystemTree(AccomodationManager, Path): void\l+ {static} LoadAccount(Path): Account\l}", + fillcolor=orchid + ]; + + Account [ + label="{Account|+ add(Reservation): boolean\l+ findReservation(String): Reservation\l+ getAllReservations(): Iterator\l+ getAccount_number(): String\l+ {static} Write(Account): void\l}" + ]; + + AccountList [ + label="{AccountList|+ add(Account): boolean\l+ find(String): Account\l+ save(Account): void\l}" + ]; + + AccountReservationList [ + label="{AccountReservationList|+ add(IReservation): boolean\l+ find(String): Reservation\l}" + ]; + + HotelReservation [ + label="{HotelReservation|+ HotelReservation(Address)\l+ calculatePrice(): float\l}" + ]; + CabinReservation [ + label="{CabinReservation|+ CabinReservation(Address)\l+ calculatePrice(): float\l}" + ]; + HouseReservation [ + label="{HouseReservation|+ HouseReservation(Address)\l+ calculatePrice(): float\l}" + ]; + + TestReservations [ + label="{TestReservations|+ {static} main(String[]): void\l}" + ]; + + "TestReservations.getRepositoryConfig" [ + label="{static class\ngetRepositoryConfig|+ {static} getPath(): String\l}" + ]; + + // --- Data/Enum/Exception Classes --- + Address [label="{Address|+ Address(String, String, String, String)\l}", fillcolor=lightblue]; + EmailAddress [label="{EmailAddress|+ EmailAddress(String)\l}", fillcolor=lightblue]; + ReservationStatusEnum [label="{enum\nReservationStatusEnum}", fillcolor=lightgray]; + DuplicateObjectException [label="{exception\nDuplicateObjectException}", fillcolor=lightpink]; + + // --- Relationships --- + + // Inheritance / Implementation + 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"]; + + // Composition / Aggregation + AccomodationManager -> AccountList [arrowhead=diamond, label="has a"]; + AccountList -> Account [arrowhead=diamond, label="0..*"]; + Account -> AccountReservationList [arrowhead=diamond, label="has a"]; + AccountReservationList -> IReservation [arrowhead=diamond, label="0..*"]; + Account -> Address [arrowhead=odiamond, label="mailing"]; + Account -> EmailAddress [arrowhead=odiamond]; + Reservation -> Address [arrowhead=odiamond, label="physical/mailing"]; + + // Dependencies + TestReservations -> AccomodationManager [arrowhead=vee, style=dashed, label="uses"]; + TestReservations -> "TestReservations.getRepositoryConfig" [arrowhead=vee, style=dashed, label="uses"]; + TestReservations -> HotelReservation [arrowhead=vee, style=dashed, label="creates"]; + TestReservations -> CabinReservation [arrowhead=vee, style=dashed, label="creates"]; + TestReservations -> HouseReservation [arrowhead=vee, style=dashed, label="creates"]; + TestReservations -> Account [arrowhead=vee, style=dashed, label="uses"]; + TestReservations -> Address [arrowhead=vee, style=dashed, label="creates"]; + TestReservations -> EmailAddress [arrowhead=vee, style=dashed, label="creates"]; + TestReservations -> DuplicateObjectException [arrowhead=vee, style=dashed, label="catches"]; + + AccomodationManager -> DataRepository [arrowhead=vee, style=dashed, label="uses"]; + AccomodationManager -> Account [arrowhead=vee, style=dashed, label="manages"]; + + Account -> DataRepository [arrowhead=vee, style=dashed, label="uses for Write()"]; + Reservation -> DataRepository [arrowhead=vee, style=dashed, label="uses for Write()"]; + Reservation -> ReservationStatusEnum [arrowhead=vee, style=dashed, label="uses"]; +}