-
Notifications
You must be signed in to change notification settings - Fork 18
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
refactor: Refine scaffolding for maintenance actions (DEV-3532) #3206
refactor: Refine scaffolding for maintenance actions (DEV-3532) #3206
Conversation
76b7349
to
ad0a19f
Compare
…ons-to-dsp-api-for-discussion
…ons-to-dsp-api-for-discussion
…ons-to-dsp-api-for-discussion
* | ||
* @param params optional parameters as provided by the caller | ||
*/ | ||
def execute(params: Option[A] = None): Task[Unit] |
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.
idea: If we would type the params
as A
you could use Any
for A
to indicate that no params are necessary. This saves us from double checking in the execute
method if params is a Some
.
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.
done in a26c378, thanks for the hint, looks much nicer.
We can then type it as Any
or Nothing
, both seem to work.
The only downside is that I cannot provide a default argument anymore, so instead of calling FooAction(null).execute()
, I have to do FooAction.execute(())
. That's slightly less intuitive, but I think it's ok.
One option to get this to work might be to have a trait NoParamMaintenanceAction
that constraints the type... but I don't think it's worth it.
…ons-to-dsp-api-for-discussion
Pull Request Checklist
Task Description/Number
This PR is mostly strictly refactoring: Moving code to separate file, etc. The most significant changes are:
PredicateObjectMapper
) and its transitive dependenciesPR Type
Basic requirements for bug fixes and features
Does this PR introduce a breaking change?
Does this PR change client-test-data?