-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdiagram.puml
More file actions
125 lines (107 loc) · 2.7 KB
/
diagram.puml
File metadata and controls
125 lines (107 loc) · 2.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
@startuml
class Main {
+main(String[] args)
}
class Cli {
-Scanner sc
-Commands commands
-Handler handler
+run()
-readCommands() : String[]
-execute(String[] input)
}
class Commands {
-Scanner sc
-boolean running
-Crud crud
+Commands(Scanner sc)
+createProduct()
+list()
+exit()
+isRunning() : boolean
}
class Handler {
-Map<String, Consumer<Commands>> commands
+Handler(Commands commandsObject)
+getCommand(String commandName) : Consumer<Commands>
}
class Crud {
-Map<String, Supplier<ClothingItem>> itemTypesMap
-ArrayList<ClothingItem> products
-StorageManager storageManager
+Crud()
+createProduct(String productType, String name,
String color, String size, float price) : ClothingItem
+readProducts()
+updateProduct
+deleteProduct(String productId)
+loadProducts()
+saveProducts()
}
class StorageManager{
-String Filename
+saveProducts(ArrayList<ClothingItem> products)
+loadProducts() : ArrayList<ClothingItem>
}
abstract class ClothingItem {
-String productId
-String name
-String color
-String size
-Float price
+setCustomAttribute(Scanner sc)
+getType(): String
+List<String> VALID_SIZES
+List<String> VALID_ITEM_TYPES
+ClothingItem(String productId, String name, String color, String size, Float price)
+isValidSize(String size) : boolean
+isValidItemType(String itemType) : boolean
+getProductId(): String
+getName(): String
+getColor(): String
+getSize(): String
+getPrice() : Float
+setProductId(String productId)
+setName(String name)
+setColor(String color)
+setSize(String size)
+setPrice(Float price)
}
class Jacket {
-String material
+Jacket(String productId, String name, String color, String size,
Float price, String material)
+getMaterial() : String
+setMaterial(String material)
+getType() : String
+setCustomAttribute(Scanner sc)
+toString() : String
}
class Jeans {
-String fit
+Jeans(String productId, String name, String color, String size,
Float price, String fit)
+getFit() : String
+setFit(String fit)
+getType() : String
+setCustomAttribute(Scanner sc)
+toString() : String
}
class Shoes {
+Shoes(String productId, String name, String color, String size, Float price)
+getType() : String
+setCustomAttribute(Scanner sc)
+toString() : String
}
Main --> "1" Cli
Cli *-- "1" Handler
Cli *-- "1" Commands
Commands *-- "1" Crud
Handler --> "1" Commands
Crud *-- "1" StorageManager
Crud *-- "0..*" ClothingItem
Crud ..> ClothingItem
ClothingItem <|-- Jacket
ClothingItem <|-- Jeans
ClothingItem <|-- Shoes
@enduml