I am starting with DI and IoC, so may be my question is not best-defined.
I read a lot of examples, as well as reading the book Dependency Injection in .NET of @MarkSeemann now.
But I probably missed some point. I don't bring any special framework example to leave the question clear.
Question 1:
Let's say, I have WinForms application
Gui1 --> (get service ip from config, pass to bl)
Gui2 --> (get service ip from user, pass to bl)
--> Business Layer --> Communication DALayer (receives service Ip Address)--> ... --> WCF Services ...
Each of the components - are separate .Net project (GUI1, GUI2, BL, DAL, ...).
I want to use any of the DI container (for example Unity, Castle, ...).
In this case, I need to init the container only once, when starting the application - it means from GUI1 file program.cs and from GUI2 file program.cs.
But - does it means, that I should add references of Both BL and DAL to the GUI1 and GUI2 projects? I mean, to be able to register the BL instance - I should provide its type to container. To do this - I should be able to "see" its type from program.cs.
Same is for DAL - I want my BL to obtain the dal from IoC container (constructor injection?).
When adding BL reference to GUI is ok, but adding the DAL refernce (and possibly other helpers, ...) to the GUI project is not ok.
I read about Windsor's installers - but it is the same issue - I can prepare installer for DAL, installer for BL - but all of the mshould be able during main install, executed from GUI projects.
I undestand, that I can specify type as a string, like" MyNamespace.MyClass", but I altho think it's not the best solution.
What am I missing here?
Thanks!