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

The Service Framework should support the Dependency Injection pattern of defining Interfaces as dependencies #58

Closed
SimonDarksideJ opened this issue Aug 26, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@SimonDarksideJ
Copy link
Contributor

Reality Collective - Reality Toolkit Feature Request

Is your feature request related to a problem? Please describe

The Dependency Injection Pattern defines a method where at design time, the developer can define the interfaces that a service needs in order to properly instantiate
https://learn.microsoft.com/en-us/dotnet/core/extensions/dependency-injection

This controls the order in which services instantiate and enable tighter "loosely coupled" integration between services and ensures a dependent service is available to wire up events when a service starts.

How would you classify your suggestion

  • Architecture / Services

Describe the solution you'd like

The ability to define service interface dependencies in the design of a service and have the service framework automatically recognise the dependency on startup.

Describe alternatives you've considered

Manual

Migrated from

realitycollective/realitytoolkit.dev#64

@SimonDarksideJ
Copy link
Contributor Author

@FejZa could you list some simple examples / use-cases to test with while building out this feature?

@FejZa
Copy link
Contributor

FejZa commented Aug 27, 2023

Not entirely sure, what you mean. But I imagine it to work like this, once it works:

MyTestServiceModule(IInputService inputService, ILocomotionService locomotionService) {}

and then those dependencies are injected with the currently active implementation of the interface.

@SimonDarksideJ
Copy link
Contributor Author

Duplicate of #84 which has more detail

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants