I’ll develop a Silverlight application, with MEF and JOUNCE.
I am a little confused about the architecture of the application. So far, I have something like that:
For the injection, I’ll use MEF and Jounce.
But I’am not sure where is the class where catalogs will be created. Jounce manages all the imports in his services class. Should I manage all the others imports (like business objects) in the UI Shell appli?
While on Internet it is easy to find examples of MEF and of Jounce, I did not find articles or book explaining how to create a good architecture using both, any link or advice?
I also cover it extensively in my upcoming book, "Designing Silverlight Business Applications." That will come with comprehensive examples.
I'm still confused about the question - what exactly is it you're trying to understand? The idea of MEF is to have a composition root, i.e. some high level entitiy that starts the dependency chain, then once that is resolved, all other imports cascade. So
if your view model references a business model interface, then that import should trigger the resolution of the dependency - again, perhaps if you are able to clarify more I'll be happy to answer as best as I can.
Hi Jeremy, thank you for your answer and thank you for Jounce !
I suppose you’re a little confused by my question because as some concepts are not clear for me, my question is not clear too.
Jounce acts as a composition root, right? Collecting views, viewmodels, publishing views…
Now, I suppose that in my application some business objects can be “pulled” by the cascade imports from the viewmodels. A viewmodel imports BO1, so when jounce imports the viewmodel, BO1 is imported too. Is that right?
Now, I suppose that some business objects could be independent of views. So they will not be imported by Jounce. Here, if I understand correctly, I need another high level entity (like UI – Shell appli in my schema) to be the composition root. Is that right?
So, I would have 2 composition roots, one in Jounce and one in UI – Shell?
Thank for your help… and you know what? I am eager to read your book :) .