Should MEF support non-shared components?

Hamilton has posted about the question of whether or not MEF should support non-shared as well as shared components (non-shared==factory and shared==singleton in our current public bits). In an ideal world we would love to support both but currently every solution we've come up with to support non-shared components has issues. We could pick a solution that we feel properly balances the advantages and disadvantages but that would require us to foresee exactly how the world is going to use MEF. While we believe we could pick a reasonable balance there is fear that we would pick the wrong balance for the majority of our future users. Therefore one approach to combat this is to not support non-shared components, at least in V1, and see what usage patterns reveal themselves in the wild and target that balance in V2.

Do you feel that it would be a mistake for the MEF team to only support shared/singleton components in V1? Keep in mind that there are patterns, as Hamilton pointed out, to still support non-shared/factory if you needed that support in V1.

1 Comment

  • It may be interesting to explain what some of the tradeoffs are with implementing support for non-shared components.

    Personally, I don't have a problem with only supporting singletons but I can see how some people might be reluctant to give up this feature without more explanation.

    Regards,
    Phil

Comments have been disabled for this content.