-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbase copy 2.puml
353 lines (277 loc) · 7.47 KB
/
base copy 2.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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
Composition *--
Aggregation o--
Extension <|--
Instantiates -. >
' ---Class name overview
' ---Car related classes---
abstract class Car{}
class CabrioCar{}
class CrossoverCar{}
class SedanCar{}
class SUVCar{}
interface Usecase{}
class RaceUsecase implements Usecase{}
class ArmyUsecase implements Usecase{}
class NormalUsecase implements Usecase{}
interface Armoring{}
class BombproofArmoring extends Armoring{}
class ElectronicArmoring extends Armoring{}
class GasResistantArmoring extends Armoring{}
class BulletproofArmoring extends Armoring{}
interface Medium{}
interface Liquid implements Medium{}
interface Gaseous implements Medium{}
interface Electricity implements Medium{}
(?)interface ArmoredParts implements Part, Armoring{}
interface Part{}
interface Engine implements Part{}
abstract class CombustionEngine extends Engine
class PetrolEngine extends CombustionEngine implements Liquid{}
class DieselEgine extends CombustionEngine implements Liquid{}
class LNGEngine extends CombustionEngine implements Gaseous{}
class HydrogenEngine extends CombustionEngine implements Gaseous{}
class ElectricEngine implements Engine, Electricity{}
interface FuelStorage implements Part{}
class LiquidFuelStorage implements FuelStorage, Liquid{}
class GaseousFuelStorage implements FuelStorage, Gaseous{}
class ElectricFuelStorage implements FuelStorage, Electricity{}
interface Fuel{}
class PetrolLiquidFuel implements Fuel, Liquid{}
class DieselLiquidFuel implements Fuel, Liquid{}
class LNGGaseousFuel implements Fuel, Gaseous{}
class HydrogenGaseousFuel implements Fuel, Gaseous{}
class ElectricFuel implements Fuel, Electricity{}
' ---Factory classes
class Factory implements Owner{}
' ---AbstractFactory class
interface DriveFactory
class ElectricDriveFactory implements CarFactory{}
class DieselDriveFactory implements CarFactory{}
class LNGDriveFactory implements CarFactory{}
class HydrogenDriveFactory implements CarFactory{}
interface CarFactory
class SUVCarFactory implements CarFactory{}
class CabrioCarFactory implements CarFactory{}
class CrossoverCarFactory implements CarFactory{}
class SedanCarFactory implements CarFactory{}
' ---Dealer classes
class Dealer implements Owner{}
' ---Customer classes
class Customer implements Owner{}
' ---Helper classes
interface Owner{}
interface Order{}
class CarOrder implements Order{}
class FactoryOrder implements Order{}
class PartOrder implements Order{}
@startuml
' ---Visual effects
skinparam SequenceMessageTextAlignment center
skinparam SequenceMessageAlignment center
skinparam rectangleBorderThickness 1
skinparam defaultTextAlignment center
skinparam lifelineStrategy solid
' left to right direction
skinparam linetype polyline
skinparam linetype ortho
' ---Dark mode
' skinparam monochrome reverse
' ---Car classes
together $car {
interface Car{
Owner owner
Part[] parts
FuelStorage[] fuel
Usecase[] use
Armoring[] armor
rangeLeft()
fill(Fuel)
drive()
}
class CabrioCar implements Car{
openroof()
closeroof()
}
class TankCar implements Car{
shoot()
}
class CrossoverCar implements Car{}
class SedanCar implements Car{}
class SUVCar implements Car{}
}
together $usecase{
interface Usecase{
defaultmode()
}
class RaceUsecase implements Usecase{
racemode()
}
class ArmyUsecase implements Usecase{
fightmode()
}
class NormalUsecase implements Usecase{}
}
together $armor{
interface Armoring{
int health
}
class BombproofArmoring implements Armoring{
int maxExplosiveForce
}
class ElectronicArmoring implements Armoring{
activate()
}
class GasResistantArmoring implements Armoring{
activate()
}
class BulletproofArmoring implements Armoring{
int maxCalibre
}
}
together $part{
interface Part{
Date made
}
interface Engine implements Part{
int torque
int pk
float efficiency
bool state
start()
stop()
accelerate()
}
abstract class LiquidEngine implements Engine{
inject()
}
' Volkswagen motors
class EA111PetrolEngine extends LiquidEngine{}
class EA211PetrolEngine extends LiquidEngine{}
class EA288DieselEgine extends LiquidEngine{}
abstract class GaseousEngine implements Engine{
inject()
}
class LNGEngine extends GaseousEngine{}
class HydrogenEngine extends GaseousEngine{}
class ElectricEngine implements Engine{
regen()
}
interface FuelStorage implements Part{
Fuel[] fuel
float capacity
bool checkFuel(Fuel f)
bool checkFull()
removeFuel(float a)
addFuel(Fuel f)
}
class LiquidFuelStorage implements FuelStorage{
LiquidFuel[] fuel
}
class GaseousFuelStorage implements FuelStorage{
GaseousFuel[] fuel
}
class ElectricFuelStorage implements FuelStorage{
ElectricFuel[] fuel
float minVolt
float maxVolt
float minAmpere
float maxAmpere
}
}
together $fuel {
interface Fuel{
float kwh
float amount
delete()
}
abstract class LiquidFuel implements Fuel{
float litre
}
class E10PetrolLiquidFuel extends LiquidFuel{}
class E5PetrolLiquidFuel extends LiquidFuel{}
class B7DieselLiquidFuel extends LiquidFuel{}
abstract class GaseousFuel implements Fuel{
float litre
}
class LNGGaseousFuel extends GaseousFuel{}
class HydrogenGaseousFuel extends GaseousFuel{}
class ElectricFuel implements Fuel{
float volt
float ampere
}
}
' ---Factory classes
together $market{
class Factory implements Owner{
FactoryOrder[] incoming_orders
Part[] parts
Car[] unfinished_cars
makePart()
makeCar()
buyPart()
sellPart()
}
' ---Dealer classes
class Dealer implements Owner{
FactoryOrder[] outgoing_orders
CarOrder[] incoming_orders
showCatalogue()
}
' ---Customer classes
class Customer implements Owner{
CarOrder[] outgoing_orders
}
' ---Helpingclasses
interface Owner{
Car[] cars
(?)int money
sell()
buy()
}
}
together $order {
interface Order{
Owner buyer
Owner seller
int price
Date start
Date end
bool completed
send()
accept()
}
class CarOrder implements Order{
Car car
}
class FactoryOrder implements Order{
Car car
int quantity
}
class PartOrder implements Order{
Part part
int quantity
}
}
' ---Relations
' ---Market relations
Owner -.> Order : "Makes an order"
Car "0..inf"--o "1" Owner
Car "0..inf"--o "1" Customer
Car "0..inf"--o "1" Dealer
Car "0..inf"--o "1" Factory
Car <.- Factory : "Produces"
Dealer <.- Customer : "Buys from"
Dealer -.> Factory : "Buys from"
' ---Car relations to its parts and features
Car --o Usecase : "has"
Car --o Armoring : "can have"
Car --o Part : "has"
Car --o "1" Owner : "has"
' ---Fuel relation with Engine
Engine -> Fuel : "burns"
' ---Fuel relation with FuelStorage
FuelStorage --o Fuel : "stores"
' ---Part relations to the factory
Factory -.> Part : "produces"
' hide $order
@enduml