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

GLSP-1393 Align Interface usage across *Manager classes #388

Merged
merged 1 commit into from
Sep 9, 2024

Conversation

ndoschek
Copy link
Contributor

What it does

  • Align interface + symbol usage for *Manager classes
    • ChangeBoundsManager, GridManager, DebugManager
  • Use bindAsService to ensure backward compatibility
  • Update injects to use the symbol instead of the actual manager class

Resolves eclipse-glsp/glsp#1393

How to test

Changing bounds, grid toggling and debug mode toggling should work as before, this should not impact the functionality at all.

Follow-ups

--

Changelog

  • This PR should be mentioned in the changelog
  • This PR introduces a breaking change (if yes, provide more details below for the changelog and the migration guide)

Copy link
Contributor

@martin-fleck-at martin-fleck-at left a comment

Choose a reason for hiding this comment

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

Thank you very much Nina! The code looks good to me in general, I just have some worries regarding the injection - which in my opinion should use the interfaces.

@tortmayr Are you happy with the general split between type/interface/class?

import { inject, injectable, optional } from 'inversify';

@injectable()
export class WorkflowStartup implements IDiagramStartup {
rank = -1;

@inject(GridManager) @optional() protected gridManager?: GridManager;
@inject(TYPES.IGridManager) @optional() protected gridManager?: GridManager;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
@inject(TYPES.IGridManager) @optional() protected gridManager?: GridManager;
@inject(TYPES.IGridManager) @optional() protected gridManager?: IGridManager;

If we are already introducing interfaces for the manager classes, we should only rely on those interfaces when injecting that class. This is true for all injection points for all manager classes.

@tortmayr
Copy link
Contributor

@tortmayr Are you happy with the general split between type/interface/class?

In general yes. I think this is the best solution to give adopters full flexibility for customizations. We just have to make sure that we keep interface and default implementation in sync if we make future changes. i.e. every public method/field of the default implementation needs to already be added to the interface.

I think this is a pattern that we could extend to our other services as well. (e.g. the selection service).

@ndoschek
Copy link
Contributor Author

ndoschek commented Sep 2, 2024

Thanks for the feedback! I'll address it in the course of the upcoming week!

- Align interface + symbol usage for *Manager classes
  - `ChangeBoundsManager`, `GridManager`, `DebugManager`
- Use bindAsService to ensure backward compatibility
- Update injects to use the interface instead of the actual manager class

Resolves eclipse-glsp/glsp#1393
@ndoschek
Copy link
Contributor Author

ndoschek commented Sep 4, 2024

Thank you both for your comments. I’ve updated my commit and created a follow-up issue (GH-1400) to apply the same pattern to other services, as Tobias suggested.

Copy link
Contributor

@martin-fleck-at martin-fleck-at left a comment

Choose a reason for hiding this comment

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

Thank you, Nina! Everything still looks good to me!

@martin-fleck-at martin-fleck-at merged commit b01477a into master Sep 9, 2024
7 checks passed
@ndoschek ndoschek deleted the issues/1393 branch September 9, 2024 12:00
ivy-lli added a commit to axonivy/process-editor-client that referenced this pull request Oct 21, 2024
@ivy-lli ivy-lli mentioned this pull request Oct 21, 2024
2 tasks
ivy-lli added a commit to axonivy/process-editor-client that referenced this pull request Oct 21, 2024
holkerveen pushed a commit to holkerveen/glsp-client that referenced this pull request Dec 21, 2024
…#388)

- Align interface + symbol usage for *Manager classes
  - `ChangeBoundsManager`, `GridManager`, `DebugManager`
- Use bindAsService to ensure backward compatibility
- Update injects to use the interface instead of the actual manager class

Resolves eclipse-glsp/glsp#1393
holkerveen pushed a commit to holkerveen/glsp-client that referenced this pull request Dec 21, 2024
…#388)

- Align interface + symbol usage for *Manager classes
  - `ChangeBoundsManager`, `GridManager`, `DebugManager`
- Use bindAsService to ensure backward compatibility
- Update injects to use the interface instead of the actual manager class

Resolves eclipse-glsp/glsp#1393
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.

Align Interface usage across *Manager classes
3 participants