Say we have several assemblies, and they all implement IAnimal, and we'd like go to one place to find out about the presence of the other IAnimal implementation.
features:
we don't want pre-knowledge outside of an assembly
there could be a register class / method within the assembly
it is preferable not to use reflection. So far this seems to be the only way though
discussion:
I imagined doing this statically via inheritance, however, I'm not aware of an assembly level initialization sequence.
I suggest taking a look at MEF. It is practically designed for this kind of thing.
It does use reflection, as this is the mechanism created for such dynamic discovery. I doubt you will find a solution that doesn't use some level of reflection.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With