Using MEF as an IoC

后端 未结 5 2128
野性不改
野性不改 2021-02-13 03:25

After reading some stuff such as this: http://mikehadlow.blogspot.com/2008/09/managed-extensibility-framework-why.html

I understand that MEF has some featcures that I wi

5条回答
  •  [愿得一人]
    2021-02-13 04:06

    An IoC follows a purpose.

    MEF specially is good designed, if you want to have some sort of plugins in your system. or code that you do not trust to run properly (dont forget to handle exceptions).

    but, it comes therefore with a overhead.

    if you just want to do IoC, as it is a good design pattern for extensible and testable software, then i would recommend AutoFac, as it is from the same guy. more or less :-)

    and, if you need both intentions. then use Both. as Matthew pointed out, you can use the CSL to abstract both. if wanted.

    for plugins -> MEF

    for your IoC -> an simple IoC

提交回复
热议问题