DevChatterBot icon indicating copy to clipboard operation
DevChatterBot copied to clipboard

Clean Up Dependency Injection

Open benrick opened this issue 6 years ago • 4 comments

Our current "poor man's dependency injection" approach isn't going to cut it much longer, we should rework it to better manage resources.

benrick avatar Mar 12 '18 22:03 benrick

I'd like to take a stab at this. Does Autofac work for you?

jdphenix avatar Apr 07 '18 23:04 jdphenix

Yes, Autofac is good, and let me know if it gets tricky.

benrick avatar Apr 08 '18 17:04 benrick

We've added autofac, but we still need to clean up here.

benrick avatar Apr 09 '18 20:04 benrick

@benrick Next steps I'm going to start on tonight are primarily two things,

  • Inspect all the interfaces #107 created, find our common functionality, and pair it down if possible, then
  • Break down modules (games, non "core" commands, twitch, etc). I'd very much like to have the only type references in the DevChatter.Bot project to be from DevChatter.Bot.Core, while everything else must implement through a single entry point per type of module (one for commands, one for chat clients). Maybe we can get a basic plugin architecture, but the worst case scenario is a single call per module in the comp root like
container.RegisterModule<TwitchModule>(); 
// etc.

jdphenix avatar Apr 10 '18 22:04 jdphenix