-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
/
Copy pathmonolithic-architecture.urm.puml
123 lines (123 loc) · 3.56 KB
/
monolithic-architecture.urm.puml
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
@startuml
package com.iluwatar.monolithic.model {
class Orders {
- id : Long
- product : Products
- quantity : Integer
- totalPrice : Double
- user : User
+ Orders()
+ Orders(id : Long, user : User, product : Products, quantity : Integer, totalPrice : Double)
# canEqual(other : Object) : boolean
+ equals(o : Object) : boolean
+ getId() : Long
+ getProduct() : Products
+ getQuantity() : Integer
+ getTotalPrice() : Double
+ getUser() : User
+ hashCode() : int
+ setId(id : Long)
+ setProduct(product : Products)
+ setQuantity(quantity : Integer)
+ setTotalPrice(totalPrice : Double)
+ setUser(user : User)
+ toString() : String
}
class Products {
- description : String
- id : Long
- name : String
- price : Double
- stock : Integer
+ Products()
+ Products(id : Long, name : String, description : String, price : Double, stock : Integer)
# canEqual(other : Object) : boolean
+ equals(o : Object) : boolean
+ getDescription() : String
+ getId() : Long
+ getName() : String
+ getPrice() : Double
+ getStock() : Integer
+ hashCode() : int
+ setDescription(description : String)
+ setId(id : Long)
+ setName(name : String)
+ setPrice(price : Double)
+ setStock(stock : Integer)
+ toString() : String
}
class User {
- email : String
- id : Long
- name : String
- password : String
+ User()
+ User(id : Long, name : String, email : String, password : String)
# canEqual(other : Object) : boolean
+ equals(o : Object) : boolean
+ getEmail() : String
+ getId() : Long
+ getName() : String
+ getPassword() : String
+ hashCode() : int
+ setEmail(email : String)
+ setId(id : Long)
+ setName(name : String)
+ setPassword(password : String)
+ toString() : String
}
}
package com.iluwatar.monolithic.repository {
interface OrderRepo {
}
interface ProductRepo {
}
interface UserRepo {
+ findByEmail(String) : User {abstract}
}
}
package com.iluwatar.monolithic.controller {
class OrderCon {
- orderRepository : OrderRepo
- productRepository : ProductRepo
- userRepository : UserRepo
+ OrderCon(orderRepository : OrderRepo, userRepository : UserRepo, productRepository : ProductRepo)
+ placeOrder(userId : Long, productId : Long, quantity : Integer) : Orders
}
class ProductCon {
- productRepository : ProductRepo
+ ProductCon(productRepository : ProductRepo)
+ addProduct(product : Products) : Products
+ getAllProducts() : List<Products>
}
class UserCon {
- userRepository : UserRepo
+ UserCon(userRepository : UserRepo)
+ registerUser(user : User) : User
}
}
package com.iluwatar.monolithic {
class EcommerceApp {
- log : Logger {static}
- orderService : OrderCon
- productService : ProductCon
- userService : UserCon
+ EcommerceApp(userService : UserCon, productService : ProductCon, orderService : OrderCon)
# addProduct(scanner : Scanner)
+ main(args : String[]) {static}
# placeOrder(scanner : Scanner)
# registerUser(scanner : Scanner)
+ run(args : String[])
}
}
UserCon --> "-userRepository" UserRepo
Orders --> "-user" User
OrderCon --> "-productRepository" ProductRepo
OrderCon --> "-userRepository" UserRepo
OrderCon --> "-orderRepository" OrderRepo
EcommerceApp --> "-userService" UserCon
Orders --> "-product" Products
ProductCon --> "-productRepository" ProductRepo
EcommerceApp --> "-productService" ProductCon
EcommerceApp --> "-orderService" OrderCon
@enduml