mirror of
https://github.com/st-tu-dresden-praktikum/swt23w23
synced 2024-07-19 21:04:36 +02:00
parent
2f9704b8c6
commit
ff8013e914
|
@ -271,8 +271,9 @@ image:models/design/user.svg[class design diagram - User]
|
||||||
|Usercontroller |A Spring MVC Controller to handle profile management.
|
|Usercontroller |A Spring MVC Controller to handle profile management.
|
||||||
|UserDataInitalizer |An Initializer with primary purpose to add the admin.
|
|UserDataInitalizer |An Initializer with primary purpose to add the admin.
|
||||||
|UserManagement |A class that manages the UserRepository.
|
|UserManagement |A class that manages the UserRepository.
|
||||||
|UserRepository |An extension of 'CrudRepository' to save Users.
|
|UserRepository |An extension of 'CrudRepository' to store Users.
|
||||||
|User |A class that allows a person to associate system data with themselves.
|
|User |A class that allows a person to associate system data with themselves.
|
||||||
|
|RegistrationForm |A Form to cache a user input that was made while registration.
|
||||||
|===
|
|===
|
||||||
|
|
||||||
=== Staff
|
=== Staff
|
||||||
|
@ -288,21 +289,6 @@ image:models/design/staff.svg[class design diagram - Staff]
|
||||||
|StaffRepository |An extension of 'CrudRepository' to perform add, save, count, remove, and find by id operations specific to staff objects.
|
|StaffRepository |An extension of 'CrudRepository' to perform add, save, count, remove, and find by id operations specific to staff objects.
|
||||||
|===
|
|===
|
||||||
|
|
||||||
=== Customer
|
|
||||||
|
|
||||||
image:models/design/customer.svg[class design diagram - Customer]
|
|
||||||
|
|
||||||
[options="header"]
|
|
||||||
|===
|
|
||||||
|Class/Enumeration |Description
|
|
||||||
|Customer |A class that represents the customer's information. It includes the customer names and surnames.
|
|
||||||
|CustomerController |A Spring MVC Controller for managing customer-related operations such as removing, and updating customer data.
|
|
||||||
|CustomerDataInitializer |An Initalizer with primary purpose to create dummy data on application startup.
|
|
||||||
|CustomerRepository |An extension of 'CrudRepository' to perform add, save, count, remove, and find by id operations specific to customer objects.
|
|
||||||
|RegistrationForm |A class to handle the data input for new customer registration. It provides methods to retrieve the information and validate the data provided through forms.
|
|
||||||
|===
|
|
||||||
|
|
||||||
|
|
||||||
=== Link between analysis and design
|
=== Link between analysis and design
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,80 +0,0 @@
|
||||||
@startuml
|
|
||||||
|
|
||||||
skinparam linetype ortho
|
|
||||||
skinparam groupInheritance 2
|
|
||||||
|
|
||||||
package java.util {
|
|
||||||
class ArrayList
|
|
||||||
class Collection
|
|
||||||
class HashSet
|
|
||||||
class Optional
|
|
||||||
class Set
|
|
||||||
}
|
|
||||||
|
|
||||||
package catering {
|
|
||||||
package customer {
|
|
||||||
|
|
||||||
class Customer {
|
|
||||||
- id: int
|
|
||||||
- surname: String
|
|
||||||
- name: String
|
|
||||||
+ Customer(name: String, surname: String)
|
|
||||||
+ getId(): int
|
|
||||||
+ getSurname(): String
|
|
||||||
+ getName(): String
|
|
||||||
+ setId(): void
|
|
||||||
+ setSurname(): void
|
|
||||||
+ setName(): void
|
|
||||||
}
|
|
||||||
|
|
||||||
class CustomerController {
|
|
||||||
+ CustomerController(customerRepository: CustomerRepository)
|
|
||||||
+ getCustomer(model Model): String
|
|
||||||
+ removeCustomer(customerID: int, model Model): String
|
|
||||||
+ editCustomer(id: int, model Model): String
|
|
||||||
+ updateCustomer(customer: Customer): String
|
|
||||||
}
|
|
||||||
|
|
||||||
class CustomerDataInitializer {
|
|
||||||
+ CustomerDataInitializer(customerRepository: CustomerRepository)
|
|
||||||
+ initialize(): void
|
|
||||||
}
|
|
||||||
|
|
||||||
class CustomerRepository {
|
|
||||||
+ CustomerRepository()
|
|
||||||
+ addCustomer(customer: Customer): boolean
|
|
||||||
+ save(customer: Customer): void
|
|
||||||
+ count(): long
|
|
||||||
+ removeCustomer(customerID: int) boolean
|
|
||||||
+ getCustomers(): Collection<Customer>
|
|
||||||
+ findById(id: int): Optional<Customer>
|
|
||||||
}
|
|
||||||
|
|
||||||
class RegistrationForm {
|
|
||||||
- name: String
|
|
||||||
- password: String
|
|
||||||
- address: String
|
|
||||||
+ RegistrationForm(String name, String password, String address)
|
|
||||||
+ getName(): String
|
|
||||||
+ getPassword(): String
|
|
||||||
+ getAddress(): String
|
|
||||||
+ validate(errors Errors): void
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
CustomerRepository *-- Customer : -customer
|
|
||||||
CustomerRepository --> CustomerController : -customerRepository
|
|
||||||
CustomerDataInitializer --> CustomerRepository : -customerRepository
|
|
||||||
RegistrationForm --> CustomerController : use
|
|
||||||
CustomerRepository --> Set : -customers
|
|
||||||
CustomerRepository --> HashSet : use
|
|
||||||
CustomerRepository --> Collection : use
|
|
||||||
CustomerRepository --> Optional : use
|
|
||||||
CustomerRepository --> ArrayList : use
|
|
||||||
|
|
||||||
RegistrationForm -[hidden]- Customer
|
|
||||||
|
|
||||||
|
|
||||||
@enduml
|
|
BIN
src/main/asciidoc/models/design/customer.svg
(Stored with Git LFS)
BIN
src/main/asciidoc/models/design/customer.svg
(Stored with Git LFS)
Binary file not shown.
|
@ -3,11 +3,13 @@
|
||||||
participant User
|
participant User
|
||||||
participant "User:customer" as User_customer
|
participant "User:customer" as User_customer
|
||||||
participant "User:admin" as User_admin
|
participant "User:admin" as User_admin
|
||||||
|
participant "UserAccount:userAccount" as userAccount
|
||||||
participant UserController
|
participant UserController
|
||||||
participant UserManagement
|
participant UserManagement
|
||||||
participant UserRepository
|
participant UserRepository
|
||||||
participant UserDataInitializier
|
participant UserDataInitializier
|
||||||
participant Spring
|
participant Spring
|
||||||
|
participant RegistrationForm
|
||||||
|
|
||||||
== Create Admin ==
|
== Create Admin ==
|
||||||
|
|
||||||
|
@ -24,62 +26,91 @@ deactivate UserManagement
|
||||||
deactivate UserDataInitializier
|
deactivate UserDataInitializier
|
||||||
deactivate User_admin
|
deactivate User_admin
|
||||||
|
|
||||||
== Create Customer ==
|
== Register Customer ==
|
||||||
|
|
||||||
UserDataInitializier -> UserManagement : createCustomer(String,String,String)
|
Spring -> UserController : register
|
||||||
activate UserDataInitializier
|
activate UserController
|
||||||
|
activate RegistrationForm
|
||||||
|
activate Spring
|
||||||
|
UserController -> RegistrationForm : getUsername()
|
||||||
|
UserController <-- RegistrationForm : String
|
||||||
|
UserController -> RegistrationForm : getPassword()
|
||||||
|
UserController <-- RegistrationForm : String
|
||||||
|
UserController -> RegistrationForm : getAddress()
|
||||||
|
UserController <-- RegistrationForm : String
|
||||||
|
UserController -> UserManagement : createCustomer(String,String,String)
|
||||||
activate UserManagement
|
activate UserManagement
|
||||||
UserManagement -> UserRepository : "save(User:customer)"
|
UserManagement -> UserRepository : "save(User:customer)"
|
||||||
activate User_customer
|
activate User_customer
|
||||||
activate UserRepository
|
activate UserRepository
|
||||||
UserManagement <-- UserRepository : User
|
UserManagement <-- UserRepository : User
|
||||||
deactivate UserRepository
|
deactivate UserRepository
|
||||||
UserDataInitializier <-- UserManagement : User
|
UserController <-- UserManagement : User
|
||||||
deactivate UserManagement
|
deactivate UserManagement
|
||||||
deactivate UserDataInitializier
|
Spring <-- UserController : "redirect:/login"
|
||||||
|
deactivate UserController
|
||||||
deactivate User_customer
|
deactivate User_customer
|
||||||
|
deactivate RegistrationForm
|
||||||
|
deactivate Spring
|
||||||
|
|
||||||
== Delete User (Customer) ==
|
== Disable Customer by Customer ==
|
||||||
|
|
||||||
Spring -> UserController : deleteUser()
|
Spring -> UserController : disableUser()
|
||||||
activate User_customer
|
activate User_customer
|
||||||
activate Spring
|
activate Spring
|
||||||
activate UserController
|
activate UserController
|
||||||
UserController -> UserManagement : deleteUser(UserIdentifier)
|
UserController -> UserManagement : disableUserAccount(UserAccount:userAccount)
|
||||||
activate UserManagement
|
activate UserManagement
|
||||||
UserManagement -> UserRepository : deleteById(UserIdentifier)
|
UserManagement -> userAccount : getId()
|
||||||
|
activate userAccount
|
||||||
|
UserManagement -> userAccount : UserIdentifier
|
||||||
|
deactivate userAccount
|
||||||
|
UserManagement -> UserRepository : disable(UserIdentifier)
|
||||||
activate UserRepository
|
activate UserRepository
|
||||||
UserManagement <-- UserRepository
|
UserManagement <-- UserRepository
|
||||||
deactivate UserRepository
|
deactivate UserRepository
|
||||||
UserController <-- UserManagement
|
UserController <-- UserManagement
|
||||||
deactivate UserManagement
|
deactivate UserManagement
|
||||||
destroy User_customer
|
|
||||||
UserController <-- Spring: "redirect:/"
|
UserController <-- Spring: "redirect:/"
|
||||||
deactivate UserController
|
deactivate UserController
|
||||||
deactivate Spring
|
deactivate Spring
|
||||||
|
deactivate User_customer
|
||||||
|
|
||||||
== View Profile ==
|
== View Profile ==
|
||||||
|
|
||||||
Spring -> UserController : index(Model)
|
Spring -> UserController : viewProfile(Model:model,UserAccount:userAccount)
|
||||||
activate User
|
activate User
|
||||||
activate Spring
|
activate Spring
|
||||||
activate UserController
|
activate UserController
|
||||||
UserController -> Spring : model.addAttribute("user",User)
|
UserController -> UserManagement : getUserByAccount(UserAccount:userAccount)
|
||||||
|
activate UserManagement
|
||||||
|
UserManagement -> UserRepository : findAll()
|
||||||
|
activate UserRepository
|
||||||
|
UserManagement <-- UserRepository : Streamble
|
||||||
|
deactivate UserRepository
|
||||||
|
UserController <-- UserManagement : Optional<User:user>
|
||||||
|
deactivate UserManagement
|
||||||
|
UserController -> Spring : model.addAttribute("user",User:user)
|
||||||
UserController <-- Spring : Model
|
UserController <-- Spring : Model
|
||||||
Spring <-- UserController : "profile"
|
Spring <-- UserController : "profile"
|
||||||
deactivate Spring
|
deactivate Spring
|
||||||
deactivate UserController
|
deactivate UserController
|
||||||
'technically spring is sending requests to User
|
|
||||||
'but i wrote these requests in profile.html
|
|
||||||
'so i'm not sure if i should add them
|
|
||||||
deactivate User
|
deactivate User
|
||||||
|
|
||||||
== Edit Profile ==
|
== Edit Profile ==
|
||||||
|
|
||||||
Spring -> UserController : editProfile(String:password,String:address,String:username)
|
Spring -> UserController : editProfile(UserAccount:LoggedIn,String:password,String:address,String:username)
|
||||||
activate User
|
activate User
|
||||||
activate Spring
|
activate Spring
|
||||||
activate UserController
|
activate UserController
|
||||||
|
UserController -> UserManagement : getUserByAccount(UserAccount:LoggedIn)
|
||||||
|
activate UserManagement
|
||||||
|
UserManagement -> UserRepository : findAll()
|
||||||
|
activate UserRepository
|
||||||
|
UserManagement <-- UserRepository : Streamble
|
||||||
|
deactivate UserRepository
|
||||||
|
UserController <-- UserManagement : Optional<User:user>
|
||||||
|
deactivate UserManagement
|
||||||
UserController -> User : [!String:username.isBlank()] setUsername(String:username)
|
UserController -> User : [!String:username.isBlank()] setUsername(String:username)
|
||||||
UserController <-- User : boolean
|
UserController <-- User : boolean
|
||||||
UserController -> User : [!String:address.isBlank()] setAddress(String:address)
|
UserController -> User : [!String:address.isBlank()] setAddress(String:address)
|
||||||
|
@ -87,8 +118,15 @@ UserController <-- User : boolean
|
||||||
UserController -> User : [!String:password.isBlank()] setPassword(String:password)
|
UserController -> User : [!String:password.isBlank()] setPassword(String:password)
|
||||||
UserController <-- User : boolean
|
UserController <-- User : boolean
|
||||||
UserController -> UserManagement : save(User:LoggedIn)
|
UserController -> UserManagement : save(User:LoggedIn)
|
||||||
|
UserManagement -> UserRepository : "save(User:LoggedIn)"
|
||||||
|
activate UserRepository
|
||||||
|
UserManagement <-- UserRepository : User
|
||||||
|
deactivate UserRepository
|
||||||
|
UserController <-- UserManagement : User
|
||||||
activate UserManagement
|
activate UserManagement
|
||||||
UserController <-- UserManagement : User
|
UserController <-- UserManagement : User
|
||||||
|
deactivate UserManagement
|
||||||
|
Spring <-- UserController : [!username.isBlank()] "redirect:/profile"
|
||||||
Spring <-- UserController : "redirect:/profile"
|
Spring <-- UserController : "redirect:/profile"
|
||||||
deactivate Spring
|
deactivate Spring
|
||||||
deactivate UserController
|
deactivate UserController
|
||||||
|
|
BIN
src/main/asciidoc/models/design/seq_users.svg
(Stored with Git LFS)
BIN
src/main/asciidoc/models/design/seq_users.svg
(Stored with Git LFS)
Binary file not shown.
|
@ -7,7 +7,13 @@ package Salespoint {
|
||||||
interface UserAccountManagement
|
interface UserAccountManagement
|
||||||
interface DataInitalizer
|
interface DataInitalizer
|
||||||
class UserAccount
|
class UserAccount
|
||||||
|
class AbstractAggregateRoot
|
||||||
|
class Role
|
||||||
|
}
|
||||||
|
|
||||||
|
package Spring {
|
||||||
class CrudRepository
|
class CrudRepository
|
||||||
|
class Streamable
|
||||||
}
|
}
|
||||||
|
|
||||||
package catering.users {
|
package catering.users {
|
||||||
|
@ -16,29 +22,50 @@ package catering.users {
|
||||||
+ User(userAccount : UserAccount, address : String)
|
+ User(userAccount : UserAccount, address : String)
|
||||||
+ User()
|
+ User()
|
||||||
+ getAddress() : String
|
+ getAddress() : String
|
||||||
+ setAddress() : String
|
+ setAddress(address:String) : String
|
||||||
+ getUsername() : String
|
+ getUsername() : String
|
||||||
+ setUsername() : boolean
|
+ setUsername(username:String) : boolean
|
||||||
+ getUserAccount() : UserAccount
|
+ getUserAccount() : UserAccount
|
||||||
+ getId() : UserIdentifier
|
+ getId() : UserIdentifier
|
||||||
|
+ isEnabled() : boolean
|
||||||
|
+ hasRole(role:String) : boolean
|
||||||
}
|
}
|
||||||
|
User ..> Role : "<<use>>"
|
||||||
User --> UserAccount : "-userAccount"
|
User --> UserAccount : "-userAccount"
|
||||||
|
User --|> AbstractAggregateRoot : <<extends>>
|
||||||
|
|
||||||
class UserController {
|
class UserController {
|
||||||
+ UserController(userManagement: UserManagement)
|
+ UserController(userManagement: UserManagement)
|
||||||
+ index(): String
|
+ unauthorized() : String
|
||||||
+ editProfile(name: String, password: String, address: String): String
|
+ register() : String
|
||||||
+ deleteUser(): String
|
+ register(form:RegistrationForm,result:Erros) : String
|
||||||
|
+ loginPage() : String
|
||||||
|
+ viewProfile(model:Model,userAccount:UserAccount) : String
|
||||||
|
+ editProfile(userAccount:UserAccount,username:String,password:String,address:String) : String
|
||||||
|
+ disableUser(userAccount:UserAccount) : String
|
||||||
|
+ getCustomer(model:Model) : String
|
||||||
|
+ removeCustomer(user:User,model:Model) : String
|
||||||
|
+ editCustomer(user:User,model:Model) : String
|
||||||
|
+ updateCustomer(user:User,username:String,address:String,model:Model)
|
||||||
}
|
}
|
||||||
UserController --> UserManagement : "-userManagement"
|
UserController --> UserManagement : "-userManagement"
|
||||||
|
UserController ..> User : "<<use>>"
|
||||||
|
UserController ..> UserAccount : "<<use>>"
|
||||||
|
UserController ..> Role : "<<use>>"
|
||||||
|
UserController ..> RegistrationForm : "<<use>>"
|
||||||
|
|
||||||
class UserManagement {
|
class UserManagement {
|
||||||
+ UserManagement(users : UserRepository, userAccounts : UserAccountManagement)
|
+ UserManagement(users:UserRepository,userAccounts:UserAccountManagement)
|
||||||
+ createUser(name: String, password: String, address: String) : user
|
+ createCustomer(name:String, password:String, address:String) : User
|
||||||
+ findAll() : Streamable
|
+ createAdmin(name:String, password:String, address:String) : User
|
||||||
|
+ save(user:User) : User
|
||||||
|
+ getUsers() : UserRepository
|
||||||
|
+ disableUserAccount(userAccount:UserAccount) : void
|
||||||
|
+ getUserByAccount(userAccount:UserAccount) : Optional<User>
|
||||||
}
|
}
|
||||||
UserManagement ---> UserAccountManagement : "-userAccounts"
|
UserManagement --> UserAccountManagement : "-userAccounts"
|
||||||
UserManagement ---> UserRepository : "-users"
|
UserManagement --> UserRepository : "-users"
|
||||||
|
UserManagement ..> User : "<<use>>"
|
||||||
class UserDataInitalizer {
|
class UserDataInitalizer {
|
||||||
- userManagement : UserManagement
|
- userManagement : UserManagement
|
||||||
+ UserDataInitalizer(userManagement : UserManagement)
|
+ UserDataInitalizer(userManagement : UserManagement)
|
||||||
|
@ -47,7 +74,20 @@ package catering.users {
|
||||||
UserDataInitalizer --> UserManagement : "-userManagement"
|
UserDataInitalizer --> UserManagement : "-userManagement"
|
||||||
UserDataInitalizer ..|> DataInitalizer
|
UserDataInitalizer ..|> DataInitalizer
|
||||||
class UserRepository {
|
class UserRepository {
|
||||||
|
+ findAll() : Streamable<User>
|
||||||
|
}
|
||||||
|
UserRepository --|> CrudRepository : <<extends>>
|
||||||
|
UserRepository ..|> Streamable : <<use>>
|
||||||
|
UserRepository o-- User
|
||||||
|
class RegistrationForm {
|
||||||
|
- username: String
|
||||||
|
- password: String
|
||||||
|
- address: String
|
||||||
|
+ RegistrationForm(username:String,password:String,address:String)
|
||||||
|
+ getUsername() : String
|
||||||
|
+ getPassword() : String
|
||||||
|
+ getAddress() : String
|
||||||
|
+ validate(errors:Erros) : void
|
||||||
}
|
}
|
||||||
UserRepository --|> CrudRepository
|
|
||||||
}
|
}
|
||||||
@enduml
|
@enduml
|
||||||
|
|
BIN
src/main/asciidoc/models/design/user.svg
(Stored with Git LFS)
BIN
src/main/asciidoc/models/design/user.svg
(Stored with Git LFS)
Binary file not shown.
|
@ -1,4 +1,4 @@
|
||||||
PLANTUML_DIAGRAMS = $(patsubst %,figures/puml/%.pdf,design/systemContextDiagram design/catalog design/catering design/customer design/inventory design/order design/staff design/user)
|
PLANTUML_DIAGRAMS = $(patsubst %,figures/puml/%.pdf,design/systemContextDiagram design/catalog design/catering design/inventory design/order design/staff design/user)
|
||||||
PLANTUML_LOCAL_DIAGRAMS = $(patsubst %,figures/puml_local/%.pdf,seq_order_add seq_order_checkout)
|
PLANTUML_LOCAL_DIAGRAMS = $(patsubst %,figures/puml_local/%.pdf,seq_order_add seq_order_checkout)
|
||||||
|
|
||||||
.PHONY: default clean
|
.PHONY: default clean
|
||||||
|
|
|
@ -133,17 +133,6 @@ Theo Reichert
|
||||||
\end{figure}
|
\end{figure}
|
||||||
\end{frame}
|
\end{frame}
|
||||||
|
|
||||||
\subsection{Kunde}
|
|
||||||
|
|
||||||
\begin{frame}
|
|
||||||
\begin{figure}
|
|
||||||
\begin{center}
|
|
||||||
\includegraphics[height=0.8\textheight]{figures/puml/design/customer}
|
|
||||||
\end{center}
|
|
||||||
\caption{Paket \texttt{customer} aus Entwicklerdokumentation, Abschnitt \textit{Building block view}}
|
|
||||||
\end{figure}
|
|
||||||
\end{frame}
|
|
||||||
|
|
||||||
\subsection{Angestellte}
|
\subsection{Angestellte}
|
||||||
|
|
||||||
\begin{frame}
|
\begin{frame}
|
||||||
|
|
Loading…
Reference in a new issue