views:

110

answers:

1

If I am working on a class library how do I make use of Ninject here? i.e., from the internal class library point of view and also from the client code?

For example:

  • should the class library have its own IOC set up, or should it always assume the client code will supply?

  • if no (ie it's up to the client to have the IOC in place) then where is the mapping data stored here'. Is this mapping of the class library's functionality to be placed in the client?

+1  A: 

If the client doesn't have an IOC what happens? Should they specify an IOC?

If the client does have an IOC does your IOC need to interact with theirs?

I don't see a problem with 2 (or more) IOC's working independently in the same app. But if the IOC's are creating the same objects then they should be put together.

Cameron MacFarland
I still confused about " where is the mapping data stored here'. Is this mapping of the class library's functionality to be places in the client?"
Greg
If the client has to provide mappings for your library it sounds like you need an internal IOC that's separate from any other IOC.
Cameron MacFarland