-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update experiment API #1065
Update experiment API #1065
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Heya @KochTobi, I tested it out and it works, nicely done! However i have a question and minor request for updated JD which would be nice if they were addressed
...anagement/src/main/java/life/qbic/projectmanagement/application/api/AsyncProjectService.java
Show resolved
Hide resolved
sealed interface ExperimentUpdateRequestBody permits ConfoundingVariableAdditions, | ||
ConfoundingVariableDeletions, ConfoundingVariableUpdates, ExperimentDescription, | ||
ExperimentalGroups, ExperimentalVariableAdditions, ExperimentalVariableDeletions { | ||
|
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since i'm not up to date i assume that i missed something so here's my question:
What's the advantage of having an interface that could be any of these possibilities?
As i saw below, this leads to the burden of the service implementation to account for all cases individually.
Could this be seperated into individual use cases to avoid an extending switch statement?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The advantage is that we do not have a lot of interface methods while the switch enforces us to implement each possible input that can be there. Given that the switch statement does not have any default path it is clear what is done where and we do not need to copy shared code (like the request id and so on) to all the single methods. Modifying a retry strategy also can be handled centrally if desired.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It could be separated into different methods which would make it easier to specify what should be done with the input. Deciding based on what was sent works too.
Co-authored-by: steffengreiner <[email protected]>
|
Hi Steffen, the changes I introduced you cannot really test out. This PR only adds the interface methods for changing the experimental variables, experimental groups and the confounding variables of experiments. It does not offer any implementation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the explanation, makes sense to me.
To clarify i tested if any of the current processes break which doesn't happen 👍
No description provided.