digraph InventoryMClassDiagram { rankdir=TB; node [shape=record, style=filled, fillcolor=lightblue]; // 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]; // 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]; // 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}"]; // Transaction 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}"]; // 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}"]; // Manager Classes (Singletons) 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}"]; // Repository 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|+ 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]; // 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"]; 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"]; InventoryList -> InventoryPiece [arrowhead=odiamond, label="contains 0..* "]; CustomerList -> Customer [arrowhead=odiamond, label="contains 0..* "]; TransactionList -> Transaction [arrowhead=odiamond, label="contains 0..* "]; // 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"]; Customer -> DataRepository [arrowhead=vee, style=dashed, label="uses"]; InventoryPiece -> DataRepository [arrowhead=vee, style=dashed, label="uses"]; Transaction -> DataRepository [arrowhead=vee, 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"]; }