This commit is contained in:
2025-10-30 14:58:45 -04:00
parent a56a01804b
commit 5afc80cbfd
5 changed files with 125 additions and 299 deletions

View File

@@ -1,90 +1,84 @@
digraph InventoryManagementSystem {
digraph InventoryMClassDiagram {
rankdir=TB;
node [shape=record, fontname=Arial, fontsize=10];
edge [fontname=Arial, fontsize=9];
// Abstract and Base Classes
InventoryPiece [label="{InventoryPiece\n(abstract)|+ id: String\n+ price: float\n+ created: ZonedDateTime\n+ title: String\n+ description: String\n+ Author: String\n- iventoryType: InventoryType|+ getId(): String\n+ setId(String): void\n+ getPrice(): float\n+ setPrice(float): void\n+ getCreated(): ZonedDateTime\n+ setCreated(ZonedDateTime): void\n+ getTitle(): String\n+ setTitle(String): void\n+ getDescription(): String\n+ setDescription(String): void\n+ getAuthor(): String\n+ setAuthor(String): void\n+ isArt(InventoryPiece): Boolean\n+ getType(): String}", style=filled, fillcolor=lightblue];
// Concrete Inventory Classes
Drawing [label="{Drawing|+ style: String\n+ technique: String\n+ category: String|+ Drawing()}", style=filled, fillcolor=lightgreen];
node [shape=record, style=filled, fillcolor=lightblue];
Painting [label="{Painting|+ height: int\n+ width: int\n+ style: String\n+ technique: String\n+ category: String|+ Painting()}", style=filled, fillcolor=lightgreen];
// Abstract Classes
InventoryPiece [label="{InventoryPiece\n«abstract»|+ id : String\l+ price : float\l+ created : ZonedDateTime\l+ title : String\l+ description : String\l+ Author : String\l|+ getType() : String\l+ computePrice() : float\l}", fillcolor=lightyellow];
Print [label="{Print|+ openEditionType: String\n+ category: String|+ Print()\n+ Print(String, String)\n+ getOpenEditionType(): String\n+ setOpenEditionType(String): void\n+ getCategory(): String\n+ setCategory(String): void}", style=filled, fillcolor=lightgreen];
// Concrete Classes - Inventory Items
Drawing [label="{Drawing|+ style : String\l+ technique : String\l+ category : String\l|+ computePrice() : float\l}", fillcolor=lightyellow];
Painting [label="{Painting|- height : int\l- width : int\l- style : String\l- technique : String\l- category : String\l|+ computePrice() : float\l}", fillcolor=lightyellow];
Print [label="{Print|- openEditionType : String\l- category : String\l|+ computePrice() : float\l}", fillcolor=lightyellow];
Sculpture [label="{Sculpture|- material : String\l- weight : float\l|+ computePrice() : float\l}", fillcolor=lightyellow];
Sculpture [label="{Sculpture|+ material: String\n+ weight: float|+ Sculpture()}", style=filled, fillcolor=lightgreen];
// Enums
InventoryType [label="{\\<\\<enumeration\\>\\>\nInventoryType|PAINTING\nDRAWING\nPRINT\nSCULPTURE}", style=filled, fillcolor=lightyellow];
// Customer and Address
Customer [label="{Customer|# id : String\l# updated : ZonedDateTime\l- phone : String\l- mailing : Address\l- email : String\l- nameFirst : String\l- nameLast : String\l|+ Customer(nameFirst, nameLast, phone, email)\l+ getId() : String\l+ getEmail() : String\l}"];
Address [label="{Address|- street : String\l- city : String\l- state : String\l- zip : String\l|+ Address(street, city, state, zip)\l+ toString() : String\l+ equals(Object) : boolean\l+ hashCode() : int\l}"];
TransactionOperationEnum [label="{\\<\\<enumeration\\>\\>\nTransactionOperationEnum|Completed\nDraft\nPricing\nRemoved\nShipping}", style=filled, fillcolor=lightyellow];
// Customer Related Classes
Customer [label="{Customer|# id: String\n# updated: ZonedDateTime\n- phone: String\n- mailing: Address\n- email: String\n- nameFirst: String\n- nameLast: String|+ Customer()\n+ Customer(String, String, String, String)\n+ getEmail(): String\n+ getId(): String\n+ setId(String): void\n+ getPhone(): String\n+ setPhone(String): void\n+ getMailing(): Address\n+ setMailing(Address): void\n+ setEmail(String): void\n+ getNameFirst(): String\n+ setNameFirst(String): void\n+ getNameLast(): String\n+ setNameLast(String): void}", style=filled, fillcolor=lightcyan];
Address [label="{Address|- street: String\n- city: String\n- state: String\n- zip: String|+ Address()\n+ Address(String, String, String, String)\n+ getStreet(): String\n+ setStreet(String): void\n+ getCity(): String\n+ setCity(String): void\n+ getState(): String\n+ setState(String): void\n+ getZip(): String\n+ setZip(String): void\n+ hashCode(): int\n+ equals(Object): boolean\n+ toString(): String}", style=filled, fillcolor=white];
// Transaction
Transaction [label="{Transaction|- id: String\n- created: ZonedDateTime\n- completed: ZonedDateTime\n- customerId: String\n- shipToAddress: Address\n- customerInventoryList: InventoryList\n- attributes: JsonArray|+ Transaction()\n+ getId(): String\n+ setId(String): void\n+ getCreated(): ZonedDateTime\n+ setCreated(ZonedDateTime): void\n+ getCompleted(): ZonedDateTime\n+ setCompleted(ZonedDateTime): void}", style=filled, fillcolor=lightcyan];
// List Classes (Collections)
InventoryList [label="{InventoryList|\\<extends ArrayList\\<InventoryPiece\\>\\>|+ InventoryList()}", style=filled, fillcolor=wheat];
Transaction [label="{Transaction|- id : String\l- created : ZonedDateTime\l- completed : ZonedDateTime\l- customerId : String\l- shipToAddress : Address\l- customerInventoryList : InventoryList\l- totalPrice : float\l- attributes : JsonArray\l|# Transaction(customer, cart)\l+ check() : void\l+ toString() : String\l}"];
CustomerList [label="{CustomerList|\\<extends ArrayList\\<Customer\\>\\>|+ CustomerList()}", style=filled, fillcolor=wheat];
// List Classes
InventoryList [label="{InventoryList|+ InventoryList()\l+ add(InventoryPiece) : boolean\l}"];
CustomerList [label="{CustomerList|+ CustomerList()\l}"];
TransactionList [label="{TransactionList|+ TransactionList()\l+ add(Transaction) : boolean\l}"];
TransactionList [label="{TransactionList|\\<extends ArrayList\\<Transaction\\>\\>|+ TransactionList()\n+ add(Transaction): boolean}", style=filled, fillcolor=wheat];
// Manager Classes (Singletons)
InventoryManager [label="{InventoryManager|+ INVENTORY: InventoryList\n- INSTANCE: InventoryManager|+ getInstance(): InventoryManager\n+ getArtPieceTypes(): Set\\<InventoryType\\>\n+ add(InventoryPiece): void\n+ find(String): InventoryPiece\n+ update(InventoryPiece): InventoryPiece\n+ save(): void\n+ loadAll(): void\n+ Remove(InventoryPiece): void}", style=filled, fillcolor=lightpink];
InventoryManager [label="{InventoryManager|+ INVENTORY : InventoryList\l- INSTANCE : InventoryManager\l|+ getInstance() : InventoryManager\l+ add(InventoryPiece) : void\l+ find(String) : InventoryPiece\l+ Remove(InventoryPiece) : InventoryPiece\l+ save() : void\l+ load() : void\l}"];
CustomerManager [label="{CustomerManager|+ CUSTOMERS : CustomerList\l- INSTANCE : CustomerManager\l|+ getInstance() : CustomerManager\l+ add(Customer) : boolean\l+ findByEmail(String) : Customer\l+ save() : void\l+ load() : void\l}"];
TransactionManager [label="{TransactionManager|+ TRANSACTIONS : TransactionList\l- INSTANCE : TransactionManager\l|+ getInstance() : TransactionManager\l+ TransactRequest(Customer, InventoryList) : Transaction\l+ complete(Transaction) : void\l+ compute(Transaction) : void\l+ save() : void\l+ load() : void\l}"];
CustomerManager [label="{CustomerManager|+ CUSTOMERS: CustomerList\n- INSTANCE: CustomerManager|+ getInstance(): CustomerManager\n+ add(Customer): boolean\n- check(Customer): void\n+ findById(String): Customer\n+ findByEmail(String): Customer}", style=filled, fillcolor=lightpink];
TransactionManager [label="{TransactionManager|+ TRANSACTIONS: TransactionList\n- INSTANCE: TransactionManager|+ getInstance(): TransactionManager\n+ TransactRequest(Customer, InventoryList, Transaction): Transaction\n+ compute(Transaction, TransactionOperationEnum): void\n+ compute(Transaction): void\n+ complete(Transaction): void\n+ findByCustomerEmail(String): TransactionList\n+ findByTransactionId(String): TransactionList\n+ findByTransactionDate(ZonedDateTime): TransactionList\n+ remove(Transaction): void\n+ save(): void}", style=filled, fillcolor=lightpink];
// Repository
DataRepository [label="{DataRepository|+ INSTANCE: DataRepository|+ getInstance(): DataRepository\n+ generateRandomID(int): String\n+ generateRandom10DigitID(): String\n+ WalkFileSystemTree(InventoryManager): void\n+ WalkFileSystemTree(CustomerManager): void\n+ WalkFileSystemTree(TransactionManager): void\n- serialize_deserialize(): void\n+ mapJsonToObjectList(String, Class\\<T\\>): List\\<T\\>}", style=filled, fillcolor=orange];
DataRepository [label="{DataRepository|- INSTANCE : DataRepository\l|+ getInstance() : DataRepository\l+ generateRandomID(int) : String\l+ generateRandom10DigitID() : String\l+ write(InventoryManager) : void\l+ write(CustomerManager) : void\l+ write(TransactionManager) : void\l+ WalkFileSystemTree(...) : void\l}" , fillcolor=lightyellow ];
// Exception Classes
InvalidArtOperationException [label="{InvalidArtOperationException|\\<extends RuntimeException\\>|+ InvalidArtOperationException(String)\n+ InvalidArtOperationException(String, Throwable)\n+ InvalidArtOperationException(Throwable)}", style=filled, fillcolor=tomato];
InvalidArtOperationException [label="{InvalidArtOperationException|+ InvalidArtOperationException(String)\l}", fillcolor=lightcoral];
InvalidRecordDataException [label="{InvalidRecordDataException|+ InvalidRecordDataException(String)\l}", fillcolor=lightcoral];
InvalidTransactionException [label="{InvalidTransactionException|+ InvalidTransactionException(String)\l}", fillcolor=lightcoral];
InvalidTransOperationException [label="{InvalidTransOperationException|+ InvalidTransOperationException(String)\l}", fillcolor=lightcoral];
InvalidRecordDataException [label="{InvalidRecordDataException|\\<extends RuntimeException\\>|+ InvalidRecordDataException(String)\n+ InvalidRecordDataException(String, Throwable)\n+ InvalidRecordDataException(Throwable)}", style=filled, fillcolor=tomato];
InvalidTransactionException [label="{InvalidTransactionException|\\<extends RuntimeException\\>|+ InvalidTransactionException(String)\n+ InvalidTransactionException(String, Throwable)\n+ InvalidTransactionException(Throwable)}", style=filled, fillcolor=tomato];
InvalidTransOperationException [label="{InvalidTransOperationException|\\<extends RuntimeException\\>|+ InvalidTransOperationException(String)\n+ InvalidTransOperationException(String, Throwable)\n+ InvalidTransOperationException(Throwable)}", style=filled, fillcolor=tomato];
// Inheritance Relationships
Drawing -> InventoryPiece [arrowhead=empty, label="extends"];
Painting -> InventoryPiece [arrowhead=empty, label="extends"];
Print -> InventoryPiece [arrowhead=empty, label="extends"];
Sculpture -> InventoryPiece [arrowhead=empty, label="extends"];
// Associations
InventoryPiece -> InventoryType [arrowhead=open, style=dashed, label="uses"];
Customer -> Address [arrowhead=diamond, label="has"];
Transaction -> Address [arrowhead=open, label="shipToAddress"];
Transaction -> InventoryList [arrowhead=open, label="customerInventoryList"];
// Manager to List relationships
InventoryList -> ArrayList [arrowhead=empty, label="extends", style=dashed];
CustomerList -> ArrayList [arrowhead=empty, label="extends", style=dashed];
TransactionList -> ArrayList [arrowhead=empty, label="extends", style=dashed];
InvalidArtOperationException -> RuntimeException [arrowhead=empty, label="extends", style=dashed];
InvalidRecordDataException -> RuntimeException [arrowhead=empty, label="extends", style=dashed];
InvalidTransactionException -> RuntimeException [arrowhead=empty, label="extends", style=dashed];
InvalidTransOperationException -> RuntimeException [arrowhead=empty, label="extends", style=dashed];
// Composition/Aggregation Relationships
Customer -> Address [arrowhead=diamond, label="mailing"];
Transaction -> Address [arrowhead=diamond, label="shipToAddress"];
Transaction -> InventoryList [arrowhead=diamond, label="customerInventoryList"];
Transaction -> Customer [arrowhead=none, style=dashed, label="customerId"];
InventoryManager -> InventoryList [arrowhead=diamond, label="INVENTORY"];
CustomerManager -> CustomerList [arrowhead=diamond, label="CUSTOMERS"];
TransactionManager -> TransactionList [arrowhead=diamond, label="TRANSACTIONS"];
// List contains relationships
InventoryList -> InventoryPiece [arrowhead=odiamond, style=dashed, label="contains 0..*"];
CustomerList -> Customer [arrowhead=odiamond, style=dashed, label="contains 0..*"];
TransactionList -> Transaction [arrowhead=diamond, style=dashed, label="contains"];
InventoryList -> InventoryPiece [arrowhead=odiamond, label="contains 0..* "];
CustomerList -> Customer [arrowhead=odiamond, label="contains 0..* "];
TransactionList -> Transaction [arrowhead=odiamond, label="contains 0..* "];
// Manager relationships
DataRepository -> InventoryManager [arrowhead=open, style=dashed, label="uses"];
DataRepository -> CustomerManager [arrowhead=open, style=dashed, label="uses"];
DataRepository -> TransactionManager [arrowhead=open, style=dashed, label="uses"];
// Dependencies
InventoryManager -> DataRepository [arrowhead=vee, style=dashed, label="uses"];
CustomerManager -> DataRepository [arrowhead=vee, style=dashed, label="uses"];
TransactionManager -> DataRepository [arrowhead=vee, style=dashed, label="uses"];
TransactionManager -> TransactionOperationEnum [arrowhead=open, style=dashed, label="uses"];
CustomerManager -> InvalidRecordDataException [arrowhead=open, style=dashed, label="throws"];
Customer -> DataRepository [arrowhead=vee, style=dashed, label="uses"];
InventoryPiece -> DataRepository [arrowhead=vee, style=dashed, label="uses"];
Transaction -> DataRepository [arrowhead=vee, style=dashed, label="uses"];
// Transaction relationships
TransactionManager -> Customer [arrowhead=open, style=dashed, label="uses"];
TransactionManager -> InventoryList [arrowhead=open, style=dashed, label="uses"];
TransactionManager -> Customer [arrowhead=vee, style=dashed, label="uses"];
TransactionManager -> InventoryList [arrowhead=vee, style=dashed, label="uses"];
// External Classes (referenced but not defined)
ArrayList [label="{ArrayList\n«Java Util»}", fillcolor=lightgray, style="filled,dashed"];
RuntimeException [label="{RuntimeException\n«Java Lang»}", fillcolor=lightgray, style="filled,dashed"];
}