Skip to content

Delegates

Andi Huber edited this page Nov 11, 2019 · 1 revision

Proposes an addition to the existing Supporting Methods

Extending on the idea of providing default values for Action parameters, we could delegate to another Action, that provides the parameter value.

We are tracking this as jira issue here.

UI Design

How this could look like (3 sketches, each slightly more sophisticated than the previous)

Sketch 1

Slide 1

Sketch 2

Slide 2

Sketch 3

Slide 3

API Design

Variant 1

@Action
Object anAction(X, Y, Z)
                ^
                :
+---------------+
:
+
X delegate0AnAction(U, V, ...); // provides a value for parameter index=0 (X)

Takes an arbitrary list of arguments (like an action).

Variant 2

@Action
Object anAction(X, Y, Z) // 'master' action
                ^
                :
+---------------+
: bound to param X
:
:   @Action
+-- X anotherAction(U, V, ...); // provides a value for parameter index=0 (X)

Binds an Action’s result to one of the 'master' Action’s parameters.

But then how to declare this binding?

  • Also this 'delegate' Action should allow reuse for other Actions as well.

  • Also for a single parameter, it could be made possible to bind multiple 'delegate' Actions.

Clone this wiki locally