c# 4.0 - Using MEF as an IoC -


After reading some stuff like this:

I understand that MEF has some featcures that I Do not meet in an IOC, and there are some IOC stuff in the MEF which are not probabili like some other IoC systems can offer.

I need MEF stuff. I also need an IOC framework or may I be okay with what MEF is?

Asher

depends on your needs / existing code

If you have an existing code infrastructure built on an IOC container, then you can actually combine them with MEF. Recently, I am building an ASP.NET MVCC + MF framework, and some of my readers have asked how I created the MEF + MVC framework, it proved to be really easy, thanks to a project Thank you for

The CSL project is designed to provide an intangible service location, so I can grab the CSL provider for unity, it is a custom export I can wire with taxpayers and MEF is automatically started introducing its IOC-driven parts.

This MEFs is a benefit of the ExportProvider model, you can easily plug in any additional providers to start exporting from different sources.

Last week (and also MEF + autofac as another exmaple), and although my examples are designed for ASP.NET MVC, the concept is mostly the same for other implementations.

If you have the option to build something new using the MEF, then you probably think that you will not need IOC container, MEF property injection, constructor injection, lifetime management, and type resolution Can handle

Let me know if you have any questions :)


Comments