Hi,
I have some trouble implementing the Unity IOC into my project reading from config file.
Here is what I have
1) ClasslibraryA
2) ClasslibraryB that references ClasslibraryA
3) Winforms App that references ClasslibraryB
Note: SomeOther app will reference ClassLibraryA, eg. a web service.
ClasslibraryA will have to be configured for IOC depending on where it is used. eg. IDataSource will be different if it is called in the web service and when it is called from a local app.
ClasslibraryB will have its own set of dependencies as well to be injected by the main application, in this case, the winforms app. ClasslibraryB will instantiate many ClasslibraryA objects in a loop.
Winforms app will contain the concrete implementation of the ClassLibraryB's dependancies implementation and Container.Configure should be called here?
My questions are,
When and where do I call the Container.Configure in the application?
Do I need child container for all sub library tiers/layers?
Should classlibraryB or the winforms implement the concrete class for ClasslibraryA to be injected into classlibraryA?
Should I group each layer/tier's IOC config into a different "Container" name in the config file?