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

[discuss] Adopt common Service interface #48455

Closed
wants to merge 1 commit into from

Conversation

joshdover
Copy link
Contributor

@joshdover joshdover commented Oct 16, 2019

Summary

This PR demos adopting the Service interface and basing the Plugin interface on it as proposed in #47065 (comment)

Currently, this only demos a single Core service using this pattern. Open questions:

  • Should we make stop required? It's currently optional for Plugin but required for CoreService
  • Should we include this ServerType utility?
  • Should we separate the Service type used by plugins vs. the CoreService type used by Core?

[skip-ci]

Checklist

Use strikethroughs to remove checklist items you don't feel are applicable to this PR.

For maintainers

@elasticmachine
Copy link
Contributor

💔 Build Failed

@joshdover
Copy link
Contributor Author

@elastic/kibana-platform thoughts on the questions posed above?

@pgayvallet
Copy link
Contributor

Should we make stop required? It's currently optional for Plugin but required for CoreService

For consistency's sake, I lean toward yes. Implementing an empty stop doesn't seems that bad in worse case scenario, and the fact that the method will always be present may helps developer about thinking that maybe they needs to put something in it.

Should we include this ServerType utility?

I'm personally against that kind of (imho way too magical) type inference. I think explicit typing makes more sense.

Should we separate the Service type used by plugins vs. the CoreService type used by Core?

I feels like that's probably 'safer'. I don't see any cons to distinguish them, and that's a safeguard if their interfaces needs to diverge at some point.

@streamich streamich added the Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc label Feb 7, 2020
@joshdover joshdover closed this May 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants