This issue is to discuss whether or not we should also add a convenience overload that allows passing in the handler directly to register an activity, as below:
df.app.activity('Hello', helloActivity);
The argument against having this overload is that activity functions, unlike orchestrations or entity functions, can accept extra input and output bindings, so there are already other valid parameters that can be passed in the options object than handler (namely extraInputs and extraOutputs). However, it's possible that this is not a very common use-case, and the convenience of having this overload for the cases in which no extra bindings are necessary still justifies adding it.
Based on discussion here.
Current implementation of the SDK for v3 includes two supported ways to register orchestrations and entity functions:
passing the handler directly:
or passing in an options object:
However, this overload isn't done for registering activities. Currently the only way to register activities is by passing in an options object:
This issue is to discuss whether or not we should also add a convenience overload that allows passing in the handler directly to register an activity, as below:
The argument against having this overload is that activity functions, unlike orchestrations or entity functions, can accept extra input and output bindings, so there are already other valid parameters that can be passed in the options object than
handler
(namelyextraInputs
andextraOutputs
). However, it's possible that this is not a very common use-case, and the convenience of having this overload for the cases in which no extra bindings are necessary still justifies adding it.