Pre-execution checks for CommandHandler #57

Closed
opened 2026-04-07 17:44:21 +02:00 by lars.winzer · 5 comments
lars.winzer commented 2026-04-07 17:44:21 +02:00 (Migrated from git.scicore.unibas.ch)

Feature Request

Summary

A system providing the ability for checks before the execution of the execute method, is needed.

Required workarround

Each check (i.e. if the session is associated with a user) has to be evaluated in the execute method. This includes responding to the request early, if a requirement is not met, and aborting further execution.

It quickly leads to a degradation of code quality as code is duplicated.

Description

The system builds on the FunctionalInterface annotation allowing for both named classes and stateless lambda.

The checks are evaluated by the CommandRouter. If all checks pass, the execute method is invoked. If not, the Response returned by the check is dispatched to the client.

Checklist

  • I have described the function in detail
  • I searched docs for alternative implementations matching my needs
  • I added relevant labels
## Feature Request <!--The reccommended type is: Task--> ### Summary A system providing the ability for checks before the execution of the execute method, is needed. ### Required workarround Each check (i.e. if the session is associated with a user) has to be evaluated in the execute method. This includes responding to the request early, if a requirement is not met, and aborting further execution. It quickly leads to a degradation of code quality as code is duplicated. ### Description The system builds on the FunctionalInterface annotation allowing for both named classes and stateless lambda. The checks are evaluated by the `CommandRouter`. If all checks pass, the execute method is invoked. If not, the `Response` returned by the check is dispatched to the client. ### Checklist - [x] I have described the function in detail - [x] I searched docs for alternative implementations matching my needs - [x] I added relevant labels
lars.winzer commented 2026-04-08 16:30:08 +02:00 (Migrated from git.scicore.unibas.ch)

assigned to @lars.winzer

assigned to @lars.winzer
lars.winzer commented 2026-04-08 16:30:47 +02:00 (Migrated from git.scicore.unibas.ch)

created branch feat/57-pre-execution-checks-for-commandhandler to address this issue

created branch [`feat/57-pre-execution-checks-for-commandhandler`](/cs108-fs26/Gruppe-13/-/compare/main...feat%2F57-pre-execution-checks-for-commandhandler) to address this issue
lars.winzer commented 2026-04-08 18:21:21 +02:00 (Migrated from git.scicore.unibas.ch)

added 1h 50m of time spent at 2026-04-08 12:00:00 +0200

added 1h 50m of time spent at 2026-04-08 12:00:00 +0200
lars.winzer commented 2026-04-08 18:29:25 +02:00 (Migrated from git.scicore.unibas.ch)

mentioned in merge request !86

mentioned in merge request !86
lars.winzer commented 2026-04-08 18:58:21 +02:00 (Migrated from git.scicore.unibas.ch)

mentioned in commit 795830cf02

mentioned in commit 795830cf02fb7c902b20839e55719235e53fe9ba
lars.winzer (Migrated from git.scicore.unibas.ch) closed this issue 2026-04-08 18:58:22 +02:00
This repo is archived. You cannot comment on issues.
1 Participants
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: University-of-Basel-Studentprojects/Programmierprojekt#57