Nearly one and a half years ago I joined the MefContrib as a contributor. Soon after I was given ownership of the projects by the guy that set it up, Bill Kratochvil. Back then MEF was still in its early preview bits and most of the stuff that existed in the MefContrib community were small sample applications on how to use MEF with ASP.NET and so on.
A lot has happened since. I am very happy to be able to announce the release of MefContrib 1.0.0.0, we tagged it a couple of days ago in our repository and you can download it from either our Github repository or at the download section of our website mefcontrib.com (we you also can get builds of the latest check-ins). A good resource for MefContrib related information is our twitter account @MefContrib, were we post news and you can also get information when new stuff is committed to the repository.
The Github page also contains a sample repository that currently host a couple of applications that shows to use the Convention Model, a way of using with with conventions instead of attributes, and the InterceptionCatalog, a catalog that uses strategies and interception hooks ? this enables things like Aspect-Orientated Programming with MEF and it is the catalog that powers all other catalogs in MefContrib.
So what can MefContrib 1.0.0.0 add to your MEF toolbox?
-
InterceptionCatalog ? This catalog lets your decorate another catalog and provide ways of adding new parts and exports at runtime, as well as to provide it with a set of interception hooks that you can use to modify parts. We ship with hooks for using DynamicProxy and LinFu together with MEF, which opens up for a completely new world of things you can do with MEF. Piotr W?odek has a very nice introduction post to the InterceptionCatalog that shows how you can use DynamicProxy to weave in new behavior at runtime.
-
ConventionCatalog ? Removes the need to use attributes when defining parts, import and exports in MEF. You use a convention based approach to let MEF know how to compose the application. This offers some great powers with very little configuration. One interesting thing it also enables you to do, it so import and export things you do not have the source code for (for adding the attributes) or that was previously designed to work with MEF
-
FilteringCatalog ? Enables you to use predicates to filter our discovered parts at runtime. For example, filter out parts that carries a specific piece of metadata or has a certain creation policy. Since it is based on a predicate you can write what ever filter you want
-
GenericCatalog ? Provides open-generic support in MEF!
-
Unity integration ? Provides a bridge between Unity and MEF, enabling both to work together to satisfy dependencies
-
FactoryExportProvider ? A custom export provider that let you take charge of the instance creation in MEF. You can read more about the FactoryExportProvider at Piotr W?odek’s blog
There are a lot more of small extensions and helpers included in the solution, so get the bits and try it out for your self. Oh, and all of the above also works great in Silverlight, using our Silverlight version of MefContrib!
If you have anything you would like to contribute to MefContrib please let us know! We are also looking for people to participate in other formats other than contributing features. Like most open-source projects, there are a lot things that needs more attention than we are able to give it at the pace that it deserves (not neglecting, just slow to get there).
- Documentation (both code and features)
- Bug reports
- Bug fixes
- Feature requests
- Feature implementations
- Test coverage
- Code quality (FxCop, NDepend and so on)
- Sample applications
So there you have it, a ton of MEF goodies for you to play with. We hope you like it and please let us know if you use the stuff in any products, would be awesome to know!
Looks like MEFfing will be soon considered the only way to write a nice aplication. I like this movement :]
Is the MefContrib site down? All I see is a “Ghost” of a web site. I’d really like to look at this InterceptionCatalog but I can’t, there’s no way to download anything!