87 lines
8.3 KiB
Plaintext
87 lines
8.3 KiB
Plaintext
digraph InventoryMClassDiagram {
|
|
rankdir=TB;
|
|
node [shape=record, fontname="Arial", fontsize=10];
|
|
edge [fontname="Arial", fontsize=9];
|
|
|
|
// Core Model Classes
|
|
Address [label="{Address|+ street : String\l+ city : String\l+ state : String\l+ zip : String\l|+ getStreet() : String\l+ setStreet(String)\l+ getCity() : String\l+ setCity(String)\l+ getState() : String\l+ setState(String)\l+ getZip() : String\l+ setZip(String)\l+ hashCode() : int\l+ equals(Object) : boolean\l+ toString() : String\l}"];
|
|
|
|
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(String, String, String, String)\l+ getId() : String\l+ setId(String)\l+ getPhone() : String\l+ setPhone(String)\l+ getMailing() : Address\l+ setMailing(Address)\l+ getEmail() : String\l+ setEmail(String)\l+ getNameFirst() : String\l+ setNameFirst(String)\l+ getNameLast() : String\l+ setNameLast(String)\l}"];
|
|
|
|
// Inventory Hierarchy
|
|
InventoryPiece [label="{«abstract»\lInventoryPiece|+ id : String\l+ price : float\l+ created : ZonedDateTime\l+ title : String\l+ description : String\l+ Author : String\l|+ InventoryPiece()\l+ getType() : String\l+ getId() : String\l+ setId(String)\l+ getPrice() : float\l+ setPrice(float)\l+ getCreated() : ZonedDateTime\l+ setCreated(ZonedDateTime)\l+ getTitle() : String\l+ setTitle(String)\l+ getDescription() : String\l+ setDescription(String)\l+ getAuthor() : String\l+ setAuthor(String)\l+ computePrice() : float\l}" style=filled, fillcolor=lightblue];
|
|
|
|
Drawing [label="{Drawing|+ style : String\l+ technique : String\l+ category : String\l|+ Drawing()\l+ computePrice() : float\l}"];
|
|
|
|
Painting [label="{Painting|- height : int\l- width : int\l- style : String\l- technique : String\l- category : String\l|+ Painting()\l+ Painting(int, int)\l+ getHeight() : int\l+ setHeight(int)\l+ getWidth() : int\l+ setWidth(int)\l+ getStyle() : String\l+ setStyle(String)\l+ getTechnique() : String\l+ setTechnique(String)\l+ getCategory() : String\l+ setCategory(String)\l+ computePrice() : float\l}"];
|
|
|
|
Print [label="{Print|- openEditionType : String\l- category : String\l|+ Print()\l+ Print(String, String)\l+ getOpenEditionType() : String\l+ setOpenEditionType(String)\l+ getCategory() : String\l+ setCategory(String)\l+ computePrice() : float\l}"];
|
|
|
|
Sculpture [label="{Sculpture|- material : String\l- weight : float\l|+ Sculpture()\l+ Sculpture(float)\l+ getMaterial() : String\l+ setMaterial(String)\l+ getWeight() : float\l+ setWeight(float)\l+ computePrice() : float\l}"];
|
|
|
|
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, InventoryList)\l+ getId() : String\l+ setId(String)\l+ getCreated() : ZonedDateTime\l+ setCreated(ZonedDateTime)\l+ getCompleted() : ZonedDateTime\l+ setCompleted(ZonedDateTime)\l+ getCustomerId() : String\l+ setCustomerId(String)\l+ getShipToAddress() : Address\l+ setShipToAddress(Address)\l+ getCustomerInventoryList() : InventoryList\l+ setCustomerInventoryList(InventoryList)\l+ getTotalPrice() : float\l+ setTotalPrice(float)\l+ getAttributes() : JsonArray\l+ setAttributes(JsonArray)\l+ toString() : String\l}"];
|
|
|
|
// List Classes (extend ArrayList)
|
|
CustomerList [label="{CustomerList|+ CustomerList()\l}" style=filled, fillcolor=lightyellow];
|
|
InventoryList [label="{InventoryList|+ InventoryList()\l+ add(InventoryPiece) : boolean\l}" style=filled, fillcolor=lightyellow];
|
|
TransactionList [label="{TransactionList|+ TransactionList()\l+ add(Transaction) : boolean\l}" style=filled, fillcolor=lightyellow];
|
|
|
|
// Manager Classes (Singletons)
|
|
CustomerManager [label="{CustomerManager|- INSTANCE : CustomerManager\l+ CUSTOMERS : CustomerList\l|+ getInstance() : CustomerManager\l+ add(Customer) : boolean\l- check(Customer)\l+ findById(String) : Customer\l+ findByEmail(String) : Customer\l+ save()\l+ load()\l}" style=filled, fillcolor=lightgreen];
|
|
|
|
InventoryManager [label="{InventoryManager|- INSTANCE : InventoryManager\l+ INVENTORY : InventoryList\l|+ getInstance() : InventoryManager\l+ add(InventoryPiece)\l+ find(String) : InventoryPiece\l+ update(InventoryPiece) : InventoryPiece\l+ Remove(InventoryPiece) : InventoryPiece\l+ save()\l+ load()\l}" style=filled, fillcolor=lightgreen];
|
|
|
|
TransactionManager [label="{TransactionManager|- INSTANCE : TransactionManager\l+ TRANSACTIONS : TransactionList\l|+ getInstance() : TransactionManager\l+ TransactRequest(Customer, InventoryList) : Transaction\l+ complete(Transaction)\l+ compute(Transaction)\l+ findByCustomerEmail(String) : TransactionList\l+ findByTransactionId(String) : TransactionList\l+ findByTransactionDate(ZonedDateTime) : TransactionList\l+ remove(Transaction)\l+ save()\l}" style=filled, fillcolor=lightgreen];
|
|
|
|
DataRepository [label="{DataRepository|- INSTANCE : DataRepository\l|+ getInstance() : DataRepository\l+ generateRandomID(int) : String\l+ generateRandom10DigitID() : String\l+ WalkFileSystemTree(InventoryManager)\l+ WalkFileSystemTree(CustomerManager)\l+ WalkFileSystemTree(TransactionManager)\l+ mapJsonToObjectList(String, Class) : List\l- write(CustomerManager)\l- write(InventoryManager)\l- read(CustomerManager, Path)\l- read(InventoryManager, Path)\l}" style=filled, fillcolor=lightcoral];
|
|
|
|
// Exception Classes
|
|
InvalidArtOperationException [label="{InvalidArtOperationException|+ InvalidArtOperationException(String)\l+ InvalidArtOperationException(String, Throwable)\l+ InvalidArtOperationException(Throwable)\l}" style=filled, fillcolor=pink];
|
|
|
|
InvalidRecordDataException [label="{InvalidRecordDataException|+ InvalidRecordDataException(String)\l+ InvalidRecordDataException(String, Throwable)\l+ InvalidRecordDataException(Throwable)\l}" style=filled, fillcolor=pink];
|
|
|
|
InvalidTransactionException [label="{InvalidTransactionException|+ InvalidTransactionException(String)\l+ InvalidTransactionException(String, Throwable)\l+ InvalidTransactionException(Throwable)\l}" style=filled, fillcolor=pink];
|
|
|
|
InvalidTransOperationException [label="{InvalidTransOperationException|+ InvalidTransOperationException(String)\l+ InvalidTransOperationException(String, Throwable)\l+ InvalidTransOperationException(Throwable)\l}" style=filled, fillcolor=pink];
|
|
|
|
// 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"];
|
|
|
|
CustomerList -> Customer [arrowhead=diamond, label="contains"];
|
|
InventoryList -> InventoryPiece [arrowhead=diamond, label="contains"];
|
|
TransactionList -> Transaction [arrowhead=diamond, label="contains"];
|
|
|
|
// Associations
|
|
Customer -> Address [arrowhead=open, label="has"];
|
|
Transaction -> Address [arrowhead=open, label="shipTo"];
|
|
Transaction -> InventoryList [arrowhead=open, label="has"];
|
|
Transaction -> Customer [arrowhead=open, style=dashed, label="references"];
|
|
|
|
// Manager relationships
|
|
CustomerManager -> CustomerList [arrowhead=diamond];
|
|
InventoryManager -> InventoryList [arrowhead=diamond];
|
|
TransactionManager -> TransactionList [arrowhead=diamond];
|
|
|
|
// DataRepository relationships
|
|
DataRepository -> CustomerManager [arrowhead=open, style=dashed, label="persists"];
|
|
DataRepository -> InventoryManager [arrowhead=open, style=dashed, label="persists"];
|
|
DataRepository -> TransactionManager [arrowhead=open, style=dashed, label="persists"];
|
|
|
|
// Exception usage
|
|
CustomerManager -> InvalidRecordDataException [arrowhead=open, style=dashed, label="throws"];
|
|
|
|
// Legend
|
|
subgraph cluster_legend {
|
|
label="Legend";
|
|
style=dashed;
|
|
|
|
legend1 [label="Abstract Class" style=filled, fillcolor=lightblue, shape=box];
|
|
legend2 [label="Manager (Singleton)" style=filled, fillcolor=lightgreen, shape=box];
|
|
legend3 [label="Collection" style=filled, fillcolor=lightyellow, shape=box];
|
|
legend4 [label="Repository" style=filled, fillcolor=lightcoral, shape=box];
|
|
legend5 [label="Exception" style=filled, fillcolor=pink, shape=box];
|
|
}
|
|
} |