If I understand your question correctly then the library is the entry point for all work done. In this situation it depends on the framework what to do. Here are some things you can do the first things are the preferred ones:
- Inspect the library and find some way to hook into the framework to intercept the creation of your objects.
- Call
kernel.Inject(this)
after an object is created by the library. Have a look at theNinject.Web
extension. There we added some base classes e.g.NinjectWebPage
forWebPage
. This new base class calls kernel.Inject after creation. New web pages can now be derived from that base class and use property injection to get dependencies. - Use the
ServiceLocator
pattern in the objects created by the libray. But just at this level. Anything deeper should use dependency injection.