Skip to content
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

GH-631 Improve to service bindings in diagram module #19

Merged
merged 1 commit into from May 4, 2022
Merged

Conversation

tortmayr
Copy link
Contributor

@tortmayr tortmayr commented May 4, 2022

Update behavior of applyBindingsTarget for binding ServiceTargets.
Add an optional autoBind flag to ServiceTarget which is enabled by default.
If the target service identifier is not bound yet and this flag is enabled we check
whether the target service can be bound to itself in singleton scope.
If so we do that, otherwise we throw an error.

This covers the most common case for our ServiceBindings: Subclassing a default implementation and then bind the service identifier to this implementation.
(e.g. bind(MyModelState).toSelf().inSingletonScope();
bind(ModelState).toService(MyModelState))

For more complex binding configurations its still possible to access the binding context directly (this.context) and apply the bindings this way.
Closes eclipse-glsp/glsp#631
Also: Fix unused model state parameter in workflow builder methods.

Update behavior of `applyBindingsTarget` for binding `ServiceTargets`.
Add an optional `autoBind` flag to `ServiceTarget` which is enabled by default.
If the target service identifier is not bound yet and this flag is enabled we check
whether the target service can be bound to itself in singleton scope.
If so we do that, otherwise we throw an error.

This covers the most common case for our `ServiceBindings`: Subclassing a default implementation and then bind the service identifier to this implementation.
(e.g. bind(MyModelState).toSelf().inSingletonScope();
bind(ModelState).toService(MyModelState))

For more complex binding configurations its still possible to access the binding context directly (this.context) and apply the bindings this way.
Closes eclipse-glsp/glsp#631
Also: Fix unused model state parameter in workflow builder methods.
@tortmayr tortmayr requested a review from planger May 4, 2022 16:15
Copy link
Member

@planger planger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, looks good to me! 👍

@tortmayr tortmayr merged commit 82d6d28 into main May 4, 2022
@tortmayr tortmayr deleted the gh-631 branch May 4, 2022 17:15
tortmayr added a commit to eclipse-glsp/glsp-examples that referenced this pull request May 4, 2022
tortmayr added a commit to eclipse-glsp/glsp-examples that referenced this pull request May 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve toService bindings in DiagramModule
2 participants