Someone has to load DLL files, and someone will be able to connect IoC.
Typically, dll loading is automatic and the IoC wire is almost hard.
You can dynamically load libraries: you can write code that tries to load each dll in a given folder and call some GetLibraryDescriptor
method. This method tells you that the library provides an implementation, for example, ISomeInterface
. Now you can ask the dll to instantiate the object of this class that it provides. You will probably have to reduce this instance to IoC. I believe that such a design is better suited for a service locator.
All of this makes sense for shrink software, but I don't see many benefits for web software.
The only reason not to refer to the other libraries that I see is to make sure that no one is using or referring to the code declared here - a tedious task, sometimes an impossible goal, that moves encapsulation to the wrong level. If your classes are well encapsulated, this is not necessary.
source share