Using MEF for Class Inheritance?

Nov 6, 2010 at 3:48 AM

Perhaps I am over thinking this, but is there anyway to use MEF for class inheritance and to override methods? I know I may be better off just inheriting a class and overriding methods normally, but I thought I'd ask anyway since MEF looks like a wonderful framework and I would love to use it in this way. I program in C#.

Nov 6, 2010 at 11:12 PM
Edited Nov 6, 2010 at 11:15 PM

Favor composition over inheritance. Build small reusable components which access each other through abstractions (interfaces). This is what dependency injection is all about. Then use a dependency injection container to wire them all together. MEF can be used like that, though it focuses more on extensions rather than general purpose dependency injection.