Docs: Add to the command deep-dive by adding a section for the HandlerCheck and CommandHandlerExecutor, including diagrams

This commit is contained in:
Lars Simon Winzer
2026-04-08 18:19:55 +02:00
parent eb2a679868
commit 6ee2c4f901
5 changed files with 62 additions and 3 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

@@ -0,0 +1,8 @@
@startuml
skinparam backgroundColor transparent
interface HandlerCheck {
+ check(request: Request): Optional<Response>
}
@enduml
Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

@@ -0,0 +1,31 @@
@startuml
skinparam backgroundColor transparent
class CommandHandlerExecutor {
- responseDispatcher: ResponseDispatcher
+ CommandHandlerExecutor(responseDispatcher: ResponseDispatcher)
+ execute(handler: CommandHandler<Request>, request: Request): void
}
interface HandlerCheck {
+ check(request: Request): Optional<Response>
}
abstract class CommandHandler<T extends Request> {
- checks: List<HandlerCheck>
# addCheck(check: HandlerCheck): void
+ getChecks(): List<HandlerCheck>
+ execute(request: T): void
}
interface ResponseDispatcher
class Request
class Response
CommandHandlerExecutor --> CommandHandler : executes
CommandHandler "1" o-- "0..*" HandlerCheck : registered checks
CommandHandlerExecutor --> HandlerCheck : evaluates
HandlerCheck ..> Request : inspects
HandlerCheck ..> Response : returns failure response
CommandHandlerExecutor --> ResponseDispatcher : dispatches failures
@enduml