I don't agree that both MEF and Autofac are IoC containers. Sure they both perform dependency injection, but MEF was never designed to solve the same issues that today's IoC containers solve. MEF is more about architecture and extensibility, where the IoC containers help us manage a set of static resources and relationships between those resources. Mef has no support for Open Generics, Automatic factories, parameterised construction, AOP and the lifetime support is more basic.
I would use mef to discover, and let me know when there are more modules, then use new ContainerBuilder().. register new components, _container.Update(containerBuilder); Regards, Jake Ginnivan Readify | Senior Developer | MVP (VSTO) M: +61 403 846 400 | E: [email protected]<mailto:[email protected]> | W: www.readify.net<http://www.readify.net/> From: [email protected] [mailto:[email protected]] On Behalf Of David Kean Sent: Thursday, 25 August 2011 10:58 PM To: ozDotNet Subject: RE: Anyone using Prism? I would either use MEF or I would use Autofac. I wouldn't mix them together. They are both IoC containers, and are both around to solve the same problems. I personally use MEF, but I worked on it so I'm a little bias. I would use MEF if you don't want to take a dependency on something outside of the framework, otherwise, I would evaluate all the good IoC containers (Castle Windsor, StructureMap, Autofac, Unity) out there and pick the one you feel most comfortable with. From: [email protected]<mailto:[email protected]> [mailto:[email protected]]<mailto:[mailto:[email protected]]> On Behalf Of Matt Siebert Sent: Thursday, August 25, 2011 5:44 AM To: ozDotNet Subject: Re: Anyone using Prism? Take a look at http://code.google.com/p/autofac/wiki/MefIntegration It's not a tutorial but shows how you could use MEF with Autofac. I haven't tried it yet but I'm about to start using MEF (and probably Autofac too) in my current project. On Thursday, August 25, 2011, Kirsten Greed <[email protected]<mailto:[email protected]>> wrote: > Thanks Jake > > Do you know of any good tutorials on MEF and Autofac? > > Kirsten > > > > ________________________________ > > From: [email protected]<mailto:[email protected]> > [mailto:[email protected]<mailto:[email protected]>] > On Behalf Of Jake Ginnivan > Sent: Thursday, 25 August 2011 1:50 PM > To: ozDotNet > Subject: RE: Anyone using Prism? > > > > Quite good timing actually, here is a post which backs up my point about > staying away from unity if you want a well performing app: > > > > http://philipm.at/2011/0808/ > > > > Another negative side effect of Prism is that modules have a single Run > method. Which you have to do your container registrations and resolve your > dependencies. > > > > Internally when you resolve, if you have performed any registrations since > you last resolved the container has to rebuild it's dependency tree, which is > costly. Autofac forces you to create a ContainerBuilder then build the > container from that, so you mentally separate registration and resolutions, > this has the advantage that Autofac does not have to lock the container when > you perform a Resolve, reducing contention and once again speeding the > container up. Unity has to lock on all operations. > > > > Regards, > > Jake Ginnivan > Readify | Senior Developer | MVP (VSTO) > > M: +61 403 846 400 | E: > [email protected]<mailto:[email protected]> | W: > www.readify.net<http://www.readify.net> <http://www.readify.net/> > > > > From: [email protected]<mailto:[email protected]> > [mailto:[email protected]<mailto:[email protected]>] > On Behalf Of J
