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.
|
||||
|UserDataInitalizer |An Initializer with primary purpose to add the admin.
|
||||
|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.
|
||||
|RegistrationForm |A Form to cache a user input that was made while registration.
|
||||
|===
|
||||
|
||||
=== 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.
|
||||
|===
|
||||
|
||||
=== 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
|
||||
|
||||
|
||||
|
|
|
@ -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:customer" as User_customer
|
||||
participant "User:admin" as User_admin
|
||||
participant "UserAccount:userAccount" as userAccount
|
||||
participant UserController
|
||||
participant UserManagement
|
||||
participant UserRepository
|
||||
participant UserDataInitializier
|
||||
participant Spring
|
||||
participant RegistrationForm
|
||||
|
||||
== Create Admin ==
|
||||
|
||||
|
@ -24,62 +26,91 @@ deactivate UserManagement
|
|||
deactivate UserDataInitializier
|
||||
deactivate User_admin
|
||||
|
||||
== Create Customer ==
|
||||
== Register Customer ==
|
||||
|
||||
UserDataInitializier -> UserManagement : createCustomer(String,String,String)
|
||||
activate UserDataInitializier
|
||||
Spring -> UserController : register
|
||||
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
|
||||
UserManagement -> UserRepository : "save(User:customer)"
|
||||
activate User_customer
|
||||
activate UserRepository
|
||||
UserManagement <-- UserRepository : User
|
||||
deactivate UserRepository
|
||||
UserDataInitializier <-- UserManagement : User
|
||||
UserController <-- UserManagement : User
|
||||
deactivate UserManagement
|
||||
deactivate UserDataInitializier
|
||||
Spring <-- UserController : "redirect:/login"
|
||||
deactivate UserController
|
||||
deactivate User_customer
|
||||
deactivate RegistrationForm
|
||||
deactivate Spring
|
||||
|
||||
== Delete User (Customer) ==
|
||||
== Disable Customer by Customer ==
|
||||
|
||||
Spring -> UserController : deleteUser()
|
||||
Spring -> UserController : disableUser()
|
||||
activate User_customer
|
||||
activate Spring
|
||||
activate UserController
|
||||
UserController -> UserManagement : deleteUser(UserIdentifier)
|
||||
UserController -> UserManagement : disableUserAccount(UserAccount:userAccount)
|
||||
activate UserManagement
|
||||
UserManagement -> UserRepository : deleteById(UserIdentifier)
|
||||
UserManagement -> userAccount : getId()
|
||||
activate userAccount
|
||||
UserManagement -> userAccount : UserIdentifier
|
||||
deactivate userAccount
|
||||
UserManagement -> UserRepository : disable(UserIdentifier)
|
||||
activate UserRepository
|
||||
UserManagement <-- UserRepository
|
||||
deactivate UserRepository
|
||||
UserController <-- UserManagement
|
||||
deactivate UserManagement
|
||||
destroy User_customer
|
||||
UserController <-- Spring: "redirect:/"
|
||||
deactivate UserController
|
||||
deactivate Spring
|
||||
deactivate User_customer
|
||||
|
||||
== View Profile ==
|
||||
|
||||
Spring -> UserController : index(Model)
|
||||
Spring -> UserController : viewProfile(Model:model,UserAccount:userAccount)
|
||||
activate User
|
||||
activate Spring
|
||||
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
|
||||
Spring <-- UserController : "profile"
|
||||
deactivate Spring
|
||||
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
|
||||
|
||||
== 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 Spring
|
||||
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 : boolean
|
||||
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 : boolean
|
||||
UserController -> UserManagement : save(User:LoggedIn)
|
||||
UserManagement -> UserRepository : "save(User:LoggedIn)"
|
||||
activate UserRepository
|
||||
UserManagement <-- UserRepository : User
|
||||
deactivate UserRepository
|
||||
UserController <-- UserManagement : User
|
||||
activate UserManagement
|
||||
UserController <-- UserManagement : User
|
||||
deactivate UserManagement
|
||||
Spring <-- UserController : [!username.isBlank()] "redirect:/profile"
|
||||
Spring <-- UserController : "redirect:/profile"
|
||||
deactivate Spring
|
||||
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 DataInitalizer
|
||||
class UserAccount
|
||||
class AbstractAggregateRoot
|
||||
class Role
|
||||
}
|
||||
|
||||
package Spring {
|
||||
class CrudRepository
|
||||
class Streamable
|
||||
}
|
||||
|
||||
package catering.users {
|
||||
|
@ -16,29 +22,50 @@ package catering.users {
|
|||
+ User(userAccount : UserAccount, address : String)
|
||||
+ User()
|
||||
+ getAddress() : String
|
||||
+ setAddress() : String
|
||||
+ setAddress(address:String) : String
|
||||
+ getUsername() : String
|
||||
+ setUsername() : boolean
|
||||
+ setUsername(username:String) : boolean
|
||||
+ getUserAccount() : UserAccount
|
||||
+ getId() : UserIdentifier
|
||||
+ isEnabled() : boolean
|
||||
+ hasRole(role:String) : boolean
|
||||
}
|
||||
User ..> Role : "<<use>>"
|
||||
User --> UserAccount : "-userAccount"
|
||||
User --|> AbstractAggregateRoot : <<extends>>
|
||||
|
||||
class UserController {
|
||||
+ UserController(userManagement: UserManagement)
|
||||
+ index(): String
|
||||
+ editProfile(name: String, password: String, address: String): String
|
||||
+ deleteUser(): String
|
||||
+ unauthorized() : String
|
||||
+ register() : 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 ..> User : "<<use>>"
|
||||
UserController ..> UserAccount : "<<use>>"
|
||||
UserController ..> Role : "<<use>>"
|
||||
UserController ..> RegistrationForm : "<<use>>"
|
||||
|
||||
class UserManagement {
|
||||
+ UserManagement(users:UserRepository,userAccounts:UserAccountManagement)
|
||||
+ createUser(name: String, password: String, address: String) : user
|
||||
+ findAll() : Streamable
|
||||
+ createCustomer(name:String, password:String, address:String) : User
|
||||
+ 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 ---> UserRepository : "-users"
|
||||
UserManagement --> UserAccountManagement : "-userAccounts"
|
||||
UserManagement --> UserRepository : "-users"
|
||||
UserManagement ..> User : "<<use>>"
|
||||
class UserDataInitalizer {
|
||||
- userManagement : UserManagement
|
||||
+ UserDataInitalizer(userManagement : UserManagement)
|
||||
|
@ -47,7 +74,20 @@ package catering.users {
|
|||
UserDataInitalizer --> UserManagement : "-userManagement"
|
||||
UserDataInitalizer ..|> DataInitalizer
|
||||
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
|
||||
|
|
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)
|
||||
|
||||
.PHONY: default clean
|
||||
|
|
|
@ -133,17 +133,6 @@ Theo Reichert
|
|||
\end{figure}
|
||||
\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}
|
||||
|
||||
\begin{frame}
|
||||
|
|
Loading…
Reference in a new issue