-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUML_A2.plant
180 lines (148 loc) · 4.63 KB
/
UML_A2.plant
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
@startuml
skinparam {
'BackgroundColor Green
classAttributeIconSize 0
}
class WakeUp <<final>> {
- userInput: java.util.Scanner
- USERCONTROL: UserControl
- ROOMCONTROL: RoomControl
- SUBSCRCONTROL: SubscriptionControl
+ main(String[] args): void
- mainMenu(): void
- loggedInMenu(): void
- credentialsPrompt(): String[]
- selectActivityPrompt(): String
- selectSubscriptionPrompt(): int
- confirmSubscriptionPrompt(int): boolean
- createUser(): void
- createSubscription(): void
- loginUser(): void
- logoutUser(): void
- bookActivity(): void
- quit(): void
}
class WakeUpHelpers {
+ validateUserID (User): boolean
+ getIDAsIntArr(String): int[]
+ sleeper(int): void
}
class CSVDB {
- CSV_FILE_PATH: Path
- writeCSVLine(String[]): void
- writeCSVMultiLine(List<String[]>): void
- readCSVFull(): List<String[]>
- debugCheck(String[]): void
}
class RoomControl <<(S, #FF7700) singleton>> {
- selectedRoom: Room
- roomDB: CSVDB
+ getRoomActivities(): String []
+ selectRoomByActivity(String activity): boolean
+ selectRoomByRoomID(int roomID): boolean
+ fetchRoomPlacesString(): String[]
+ fetchRoomPlacesList(): List<String>
+ fetchRoomPlacesBookingsList(): HashMap<String, String>
+ assignUserToRoomPlace(String userID, String placeID): void
+ createRoom(String[]): boolean
}
class Room {
- type: Activity
- id: String
- roomPlaces: String[][]
- ALPHABET: char[]
+ setActivity(String): void
+ getActivity(): Activity
+ getAllPlaces(): String []
+ getBookedPlaces(): String[]
+ setBookedPlace(int placeID): boolean
- generatePlaces(int, int): void
+ toString(): String
+ toArray(): String[]
}
enum Activity <<enumerate>> {
1: SPINNING
2: AEROBICS
3: YOGA
}
class UserControl <<(S, #FF7700) singleton>> {
- userDB: CSVDB
- selectedUser: User
- authenticatedUser: User
+ createUser(String userName, String userID): boolean
+ selectUserByUserName(String userName): boolean
+ selectUserByUserID(int userID): boolean
+ loginSelectedUser(): boolean
+ logoutSelectedUser(): boolean
+ removeSelectedUser(): boolean
+ isAuthenticatedUser(): boolean
+ getSelectedUserID(): String
+ getSelectedUserStatus(): boolean
+ setSelectedUSerStatus(String): boolean
+ updateSelectedUser(): void
}
class User {
- name: String
- id: String
- status: boolean
+ getID(): String
+ getName(): String
+ getStatus(): String
+ setStatus(): String
+ toString(): String
+ toArray(): String[]
}
class SubscriptionControl <<(S, #FF7700) singleton>> {
- selectedSubscription: Subscription
- subscriptionDB: CSVDB
+ calculateCost(): double
+ checkSubscriptionExists(): boolean
+ checkSubscriptionValidNow(): boolean
+ getStatus(): boolean
+ setStatus(String): boolean
+ createSubscription(sDate, eDate, userID): boolean
+ selectSubscriptionByUserID(int userID): void
}
class Subscription {
- sDate: Date
- eDate: Date
- userID: String
- status: boolean
+ setSDate(Date): void
+ setEDate(Date): void
+ getStatus(): boolean
+ setStatus(String): void
+ getMonths(): int
+ toString(): String
+ toArray(): String[]
}
'--- Notes on Diagram ---
'note right of UserControl: If the user is authenitcated\nthen authorUser is set.
note "CSVDB is used by all the singleton \nobject control classes." as Note1
'--- Relations ---
WakeUp --> UserControl: <<call>>
'note on link: This could be easy to forget.
'User --> Subscription: <<call>>
SubscriptionControl *-- Subscription: <<create>>
UserControl *-- User: <<create>>
RoomControl <-- WakeUp: <<call>>
Room -* RoomControl
'WakeUp -> AuthControl: <<call>>
Activity --> Room: <<use>>
WakeUp -> WakeUpHelpers: <<call>>
SubscriptionControl <- WakeUp: <<call>>
@enduml
--- CnP_dump ---
Det finns 3 olika typer av aktiviteter (Spinning, Aerobics, och Yoga) och varje aktivitet har totalt 9 platser fördelat
på 3 rader i salen (rad 1-3, plats a, b, c).
hide Användare
show Användare
Class01 "1" *-- "many" Class02 : contains
Class03 o-- Class04 : aggregation
Class05 --> "1" Class06
Usually, a spotted character (C, I, E or A) is used for classes, interface, enum and abstract classes
class System << (S,# FF7700) Singleton >>
Modelling considerations
There are no abstract classes
note top of WakeUp: important: remember to!
note right of RoomControl: