You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reality Collective - Service Framework Feature Request
Overview
Let's start talking about dependency injection and what it might look like for the service framework.
Ideally, I see this being implemented in 3 steps:
Service injection for services
Service injection for MonoBehaviours
Service injection for plain C# classes
1. Service injection for services
In a fist step it would already be beneficial to support having the service manager inject dependencies into other services as requested. This would already save a lot of boilerplate code. Here is what I imagine that to look like
We use the Initialize() API to let developers specify any dependencies their service has and then have the service manager resolve those. We cannot use the service constructor for this, since that would introduce issues with dependencies not being registered with the service container yet. We should prefer method injection here so we can guarantee that all services are registered with the locator at the time of dependency injection.
The text was updated successfully, but these errors were encountered:
Reality Collective - Service Framework Feature Request
Overview
Let's start talking about dependency injection and what it might look like for the service framework.
Ideally, I see this being implemented in 3 steps:
1. Service injection for services
In a fist step it would already be beneficial to support having the service manager inject dependencies into other services as requested. This would already save a lot of boilerplate code. Here is what I imagine that to look like
We use the
Initialize()
API to let developers specify any dependencies their service has and then have the service manager resolve those. We cannot use the service constructor for this, since that would introduce issues with dependencies not being registered with the service container yet. We should prefer method injection here so we can guarantee that all services are registered with the locator at the time of dependency injection.The text was updated successfully, but these errors were encountered: