I'm using Calcium and some other Prism based projects (such as the StockTraderRI in the Prism4 release) to jump in the deep end learning to work with WPF/CAL/IoC and related technologies.
When comparing your work with Calcium with the mentioned StocktraderRI I noticed a few things. For one, the StocktraderRI was apparently moved to MEF as opposed to Unity for taking care of dependency injection. The choice between MEF and Unity greatly determines
the way things can be implemented and there are a few things I do not or only partially understand about these differences:
1) As far as I can tell you spent quite some effort to devise a system where you can discover modules within assembly files in directories (using your CustomModuleCatalog). Am I correct in assuming that this is because Unity does not offer functionality
similar to DirectoryCatalog/AggregateCatalog offered by MEF? Ergo, that in this respect, MEF is a bit "easier"?
2) In the stocktrader RI, as far as I can tell, all services are injected into the constructors of the different Modules/Viewmodels. You rely heavily on ServiceLocatorSingleton. Could you tell me something more about why you chose to go this route? I know
there is a lot of "DependencyInjection vs. ServiceLocation" literature online but for the most part these articles are generally quite "academic". I have some difficulty wrapping my head around some of it out of the context of a real application.
3) As an exercise I would like to try and leverage some of the Calcium code to rely on MEF instead of unity. I would like to start by grafting some things like the IFileService/FileService into a module that I could plug into the StockTraderRI project. Is
this feasible or are there some aspects of the services that you wrote that are essentially requiring use of Unity?
4) One last thing I do not understand is why a service like FileService has the following line: static readonly ILog log = LogManager.GetLogger(typeof(FileService)); If I want to log some aspects of the Service during its operation, why dont I
inject a common logger instance from the container? I am confused because I thought a logger is already defined in the bootstrapper.
As you can tell I am probably not very well versed in the different topics but there is just so much to learn, therefore any answers to my questions above would help me out a lot!
Keep up the good work, Calcium looks like a very useful project, not only for Application development but certainly also for learning about ways to use all these technologies!