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

Enable searching for inherited services #110

Merged
merged 1 commit into from
Oct 22, 2024

Conversation

SimonDarksideJ
Copy link
Contributor

Reality Collective - Service Framework Pull Request

Overview

In cases where you want a generic search for services implemented with a base interface, this change enables this capability, e.g.

Base Interface : IApplicationSettings
Generic Interface : IMyApplicationSettings : IApplication Settings.

Now the service is searchable by either its base interface "IMyApplicationSettings" or its inherited interface "IApplicationSettings".

Warning, if there are multiple services registered with the same inherited interface, ONLY the first registered instance would be found. To get all services returned with the inherited interface, then "GetAllServices" should be used.

Changes

  • Updates

Breaking Changes

  • Updates "TryGetService" to allow an additional search for inherited interface should the initial search fail
  • Updates tests which were affected by this chaneg (expected null where now it is not)

Testing status

  • Includes unit tests.

Breaking change

Should implementations expect a failure where inherited services look for a single service, these will now return the first service with the inherited interface.

@SimonDarksideJ SimonDarksideJ requested a review from FejZa as a code owner October 21, 2024 18:13
@FejZa
Copy link
Contributor

FejZa commented Oct 22, 2024

Looks good and should not be breaking anything.

@SimonDarksideJ SimonDarksideJ merged commit 819940b into development Oct 22, 2024
27 checks passed
@SimonDarksideJ SimonDarksideJ deleted the feature/inheritedServiceLookup branch October 22, 2024 10:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants