csharpfritz / csharpfritz/Quiltoni.PixelBot
Refactor resolving services into its own actor
- Dominant language
- C#
- Stars
- 21
- Forks
- 9
- PR merge metrics
- No merged PRs in 30d
Description
Currently it gets very messy if an actor needs a service to resolve from the DI container. Most actors are currently created and supervised by the ChannelManagerActor which makes its constructor very "messy" and most of the services are not directly used by this actor but only by the actors it creates.
My proposal is to refactor the responsibilities into a dedicated ```ResolveServicesActor``` that receives the dependency container in the constructor and returns the requested service when it is ```Ask()``` with a ```RequesService``` message.
This lets every actor request the services it needs from the DI container independent of its parent actor. This also decouples the child from the parent actor and make it easier to implement new functionality without constantly having to change the parent actor and ```Startup.cs```.
A similar thing could be done with Configuration or things with the Repository pattern.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.