I read a few things around on this site :
- It is best to configure our container at the launch the application
- It is best to avoid making our libraries dependent on a dependency injection framework
- It is recommended to use factories to initialize objects whose properties are defined at the runtime
I use Ninject. If I understand these recommendations, it is necessary that:
- My libraries do not use NInject.dll
- Therefore, my NinjectModules must be defined in the project of my application
- My factories (which are created on this principle) must also be defined in the project of my application, and not directly in the library
That seems strange, especially for factories. I have many projects that use the same library. Should all these projects redefine ninject modules and factories?
What do you think ?